Repository navigation
fix: validate updater size before caching - #84
Conversation
|
Thanks for fixing the cache-validation inconsistency. I would like one additional updater-safety condition before merging: the download must enforce At the moment, Please add the following safeguards:
This behavior predates the PR, so I do not consider it a regression introduced here. However, because this change establishes the updater's size-validation behavior, I would prefer to close the remaining disk-exhaustion path in the same PR. |
|
Will do - be with you after world cup final :) |
|
Implemented the feedback in
Validation passed:
|
|
Thank you for addressing the earlier updater-safety feedback. The implementation now rejects a mismatched Content-Length before writing, bounds streamed and chunked responses by the signed I also verified the branch locally: all 13 There are two remaining follow-ups I would like to request before merging:
After the new Content-Length preflight check was added, Please add a test using a response without Content-Length, where:
The existing Content-Length and oversized chunked-response tests should remain as separate coverage.
The signed size is inexpensive to validate using The current CI failure in The two feature commits are currently unsigned, while the existing merge commit is verified. Please ensure that all rewritten commits are signed and verified after the rebase. Squashing the feature work into one signed commit is also completely fine. Thank you again for implementing the streaming safeguards. Once these follow-ups are pushed and CI passes on the current master, I will re-review the updated diff. |
77ec395 to
2a3d149
Compare
|
Update to PR:
Process update:
|
An updater package rejected for a size mismatch can currently be accepted from cache on the next attempt.
What changed
sizeBytesthrough one shared file check..partfile before moving it into the final version cache.Closes #83.
Observable behavior
Ok(UpdatePackage { ... })from the hash-only cache path.Actual screenshots
Both screenshots use macOS 26.5.2, Apple silicon, and Rust 1.95.0 with the same focused command:
cargo test -p frame-updater download_rejects_size_mismatch_on_repeated_attempts -- --nocaptureBefore — base revision
04d8b08; the second attempt is accepted from cache:After — commit
4ba64bf; the same regression passes:Verification
cargo test --manifest-path frame-updater/Cargo.tomlcargo clippy --manifest-path frame-updater/Cargo.toml --all-targets --locked -- -D warningscargo xtask ci