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.
- Stage every payload file (Hidden included) and verify SHA256 before committing; app mode replaces resources/app as a whole tree, so old-only files do not accumulate. - Verify the committed tree bytes after commit; restore the pre-change tree and verify its bytes before allowing an old-version relaunch. - Exit 3 and suppress relaunch when restoration cannot be verified; exit 2 when the replacement is verified but both launch requests fail. - Keep payload/version dir and write .apkstart-force-full on apply failure; cleanup failures are warnings only, not rollback. - Treat only installer exit 0 as success; no relaunch after installer failure. - Keep production -EncodedCommand dispatch under the Windows command-line limit (strip indentation for the inline script, guard encoded length). - Add seven app TEMP fixture cases and retain thirteen zip/setup cases; wire the Windows suite into npm test.
- Keep the ~12k-char helper out of the CreateProcess command line; the frozen ROOT-R5-DISPATCH probe failed 4/4 after the transactional port because UTF-16LE base64 reached 32108-34156 chars. - Write the BOM-prefixed UTF-8 helper to a unique file under the update dir, pass path plus SHA-256 in a bounded bootstrap, read bytes once, verify, then decode and execute the same buffer; delete the helper after the verified read. - Add production-dispatch Windows cases (long path with quote/spaces, Chinese path, short path, tampered-helper refusal) and assert the captured spawn command stays bounded; keep the 20 existing app/zip/setup cases. - Record the installed tree digest in the launch stub so A04 proves the old tree was restored before the old-version launch request. - Fix the $rollbackAllowed typo in the relaunch-reason guard (undefined variable was always truthy; no transaction behavior depended on it).
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 update-apply path needs to distinguish verified replacement, successful recovery, and a successful request to restart. A matching executable length or
package.jsonversion alone is insufficient evidence that all required files were installed. The current incremental app path also needs verified recovery before restarting an old installation.Dependency and review range
This draft depends on #117. It preserves that branch's release-identity and cached-resume changes. The additional apply changes are 79338bb...8136876. The full PR diff against upstream main includes the dependency; please review/land #117 first. No upstream merge or release is performed here.
Changes
resources/apptree, removing obsolete old-only files while preserving the Electron shell, runtime and user data.Validation
Exact head:
8136876c622372c1a8aef8f93c2ddc2423cd87e6.b4ee5b7reproduces 5/24 under the short alias. This matches the preserved first failed CI, and establishes the path fix without removing cases or weakening assertions.-EncodedCommandcases pass: Unicode/quotes/spaces, a longer path, and helper tampering refused before helper waits/launches. Eight independent relative-path boundary checks pass.Limits
All app, installer, cmd-launch and process-wait calls are intercepted in the private test processes. Real PowerShell and TEMP file operations run; applications/installers, Android boot and a live user's upgrade do not. The partial-replace/restore faults are explicit test injections, not claims of reproducing an actual OS error1177.
The optional APK fixture case still explicitly skips when no external APK is supplied. Fork CI success is separate from upstream workflow approval. No security severity or CWE/CVE claim is made from these functional tests.