A completed label in a download list does not answer every question about the file handed to the next task. My automation download path reads size from the saved location and hashes the content after the completion event. I wanted the returned receipt to explain the checks behind the word received.
Wait for the first transfer attributed to the current tab
DownloadFrom subscribes to will-download on the current profile session before invoking the triggering action. Events from a different source webContents ID are ignored. After one item is tracked, an additional item from the same source is cancelled. This narrows the transfer associated with the action instead of guessing from the most recent global download.
That association is not a server-issued business request ID. It uses the boundary provided by a tab and native events. Other routes, including native chooser and popup behavior, require their own checks. I do not describe this function as automatically understanding every download mechanism on every website merely because it can associate a normal native event with its source tab.
A completed event still needs a saved-file read
The done handler first requires completed state; cancellation and interruption do not become normal completion. It then stats the path returned by getSavePath and compares actual size with the native received-byte counter. A difference produces DOWNLOAD_SIZE_MISMATCH.
The saved file is then streamed into SHA256, with cancellation checks between chunks rather than loading the entire file into memory at once. Missing or unreadable files do not produce successful receipts. A completion event starts these checks; it is not a substitute for them. This ordering makes a failure after transport completion understandable instead of reporting a file that the next stage cannot actually read.
A fingerprint gains another meaning when an expected one exists
The receipt contains a record ID, filename, actual size and SHA256. It gives later work a fingerprint without exposing the save path in this public result. Computing a new digest differs from comparing it with the expected original digest. Without an expected fingerprint, no original-versus-result comparison has occurred.
A hash helps distinguish equal-size different content, but does not prove a video plays to the end or a document contains the right information. This function also does not monitor every future file change. I kept transport-result evidence separate from format and business-content validation so later stages can make their own checks without inheriting a stronger guarantee than the receipt provides.
Rejections and cancellation need cleanup as well
A rejection handler is attached to the completion promise before the click action. A native event can fail while the triggering action is still awaited, and the ordering prevents that early rejection from becoming unhandled. Finally removes both timer and event listener. Cleanup limited to success would leave failed waits attached to later work.
The timeout budget covers transfer and hashing while intentional user pause has separate treatment; task cancellation remains checked. Increasing a wait does not start another download. The implementation therefore manages both the native transfer lifetime and the waiting call lifetime. That is part of producing a trustworthy result, even though it does not appear in the saved file itself.
Distinguish the original test design from current verification
The existing file-audit test includes Korean and long names, empty files, unsafe-character handling, and actual-byte comparisons for sequential and concurrent same-name downloads. I read those test paths for this article; I did not newly execute the original application. Test code existing in a repository is different evidence from a current service run passing it.
The shared module hashes synthetic bytes actually supplied to it and compares declared completion, received count and an optional expected digest. It locates and downloads no file, so network provenance and disk durability remain unverified. Running that smaller comparison makes the separate meanings of completion state, matching size and matching original digest visible without claiming the missing integration.