Repository navigation
Conversation
downloadMulti 在 dedup/单源检查后、并行探测前早退:无 expectSha256 时走 downloadAnyParallel 逐源整包尝试,换源前 discardPartial,返回 sources:1/multi:false/resumed:false,且不读写 .chunks.json;有锚路径字节不变。新增 6 个无锚/取消/能力保留测试到 range-validation-test.js(RED: 混块与 stale resume 两例失败;GREEN: 19/19)。带宽代价:无锚时不再叠加多镜像带宽,但所有排名源仍逐个可用。auto-test.js:1764/:1808/:1907 re-anchored — old assertions pinned no-anchor cross-mirror mixing (the removed BUG-NOANCHOR contract); capability coverage preserved on the anchored path.
Carry GitHub asset SHA-256 with its source identity into runtime and full update downloads. Preserve unanchored compatibility and avoid applying a GitHub digest to a separately repacked asset.
Validate release identity before rebuilding cached full or incremental payloads, serialize update operations, and preserve verified archives on failure. Select the app asset separately, support app-only archives, and await every asynchronous regression before reporting success.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The downloader changes in #103 can verify a supplied SHA-256 digest, but the release/runtime callers also need to carry the official asset identity through to the download. A retained update directory must be verified against current release metadata before it is resumed.
The app-only update path exposes two additional failures: a release containing only
*-app.zipis not selected correctly for resume, and rebuilding that archive incorrectly requires the executable that exists only in a full portable package. The previous asynchronous incremental tests could report success before their assertions completed.Changes
Parse valid GitHub asset SHA-256 digests and pass them to runtime/full-update downloads. Mirror metadata cannot supply or overwrite the official digest; conflicting official digests remove the verification anchor.
Verify the retained archive against fresh, matching release metadata and rebuild payloads from verified archive bytes. Missing, stale or mismatched identity declines automatic resume and retains the cached data.
Select portable and app-only assets separately from the same metadata response. App-only payloads require their app package metadata, carry
mode: 'app', and do not require an executable.Rebuild a manually prepared app payload instead of trusting an old ready marker. Verify manifest files before publishing the rebuilt directory.
Coordinate boot resume and manual updates through one ownership gate so cancellation cannot release another update's gate.
Await incremental test cases before counting results or exiting, with a controlled delayed-failure mode that must exit nonzero.
Add focused release-identity, resume-identity, app-only and preservation regressions.
Relationship to #103
This branch preserves the original #103 commits, including head
414db215a46a493e839ad75d7867a8b63ec87154, as ancestors. It merges the current upstream baselinea4d4a23cdd20d8943703ae172a0c8734ca23b097and then adds two semantic commits for release identity and verified resume. #103 has not been rebased or force-pushed.Until #103 is merged, its download changes also appear in this PR's diff.
Validation
On Windows with Node 24.19.0, the candidate tree passed:
node test/incremental-test.js: 11 passed.node test/incremental-resume-app-test.js: 11 passed, using real small ZIP fixtures and local HTTP where needed.node test/release-identity-test.js: 18 passed.node test/resume-identity-test.js: 44 passed.node test/range-validation-test.js,node test/issue-hardening-test.js, and the fullnpm.cmd testcommand: exit 0.Controlled
APKSTART_TEST_LATE_FAIL=1: 11 passed, 1 deliberately failed, native exit 1. The old harness incorrectly exited 0 under the delayed-failure control.An unchanged independent six-case Windows probe failed on the previous resume candidate (the retained Windows baseline record is 3/6) and passed 6/6 on this head, including app-only and dual-asset releases, archive bytes, marker identity and preservation controls.
The public branch has the exact Git tree of the tested candidate
4ce389ffbc560ac08306f7629fb3ade00ad5caeb:f983ffc86532f3212b1af5d4cc01badcd707874e.Transient Windows rename failures observed during testing were retained in the review records; a bounded retry was added for the payload publication rename. This does not claim every filesystem failure is recoverable.
Scope and remaining verification
This addresses update preparation and resume. It does not claim that the complete real application update/restart cycle or all reports under #98 are resolved. Executing the generated PowerShell apply/rollback helper, real GUI/APK launches, installer flows and large runtime downloads remain separate verification work.
The manual incremental download path still validates the archive against its manifest; this PR does not claim to add a separate official digest anchor for that manifest.
Upstream workflow approval and the fork validation below are separate statuses.
Windows CI verification (2026-11-21)
The existing CI workflow passed on the exact head
79338bb969c9dfed3070010cc9a123078d22bbecin the contributor fork: 44879081182. Both Windows / Node 20 and Node 22 jobs completed successfully, including dependency installation, the test command and the pointer-hook smoke test.The APK-fixture test self-skipped because no APK fixture / APKSTART_TEST_APK was supplied. The successful workflow does not count that scenario as exercised.
This is a fork CI result for the reviewed commit. It does not change the upstream workflow approval state or establish real GUI, installer, application health or update/restart acceptance.