Repository navigation
fix(web): resume the gallery's wasm download after an interruption - #2644
Merged
Merged
Conversation
Laotree
force-pushed
the
feature/resume-gallery-download
branch
from
November 27, 2026 11:20
bb305ef to
7589fee
Compare
Laotree
force-pushed
the
feature/resume-gallery-download
branch
2 times, most recently
from
November 27, 2026 12:02
5b6a557 to
1bf78ce
Compare
Contributor
Author
|
Note for whoever lands this: #2650 changes |
This was referenced Nov 27, 2026
oneo-me
force-pushed
the
feature/resume-gallery-download
branch
from
November 29, 2026 11:40
1bf78ce to
294105a
Compare
oneo-me
force-pushed
the
feature/resume-gallery-download
branch
from
November 29, 2026 12:43
294105a to
724f9b6
Compare
A tab switch, a reload or a platform change dropped the downloaded bytes, so the 15 MB wasm started again. Keep each batch in IndexedDB, continue a stored prefix with a Range request, and check every answer against Content-Range before joining bytes. The shell's stall timer no longer counts the time a hidden page spends away. Refs nsgo-dev#2590 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oneo-me
force-pushed
the
feature/resume-gallery-download
branch
from
November 29, 2026 12:43
724f9b6 to
a84474d
Compare
oneo-me
enabled auto-merge (rebase)
November 29, 2026 12:54
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.
Summary
Switching tabs, reloading the page or changing the platform in the gallery dropped the 15 MB wasm download and started it again. The loader now keeps each batch in IndexedDB and continues a stored prefix with a
Rangerequest; every answer is checked againstContent-Rangebefore the bytes are joined. The shell's 45 s watchdog is a stall timer now: progress resets it, and time spent hidden does not count.Fixes #2590.
Targets
Screenshots
None: the boot screen keeps its layout. While the page is hidden it shows "Paused. The download continues when you return."
Verification
a84474d28802ae29d121f1b8349feb48e7dd1deff01acedfbfd98b4cb747c753fb99aaa34675f90ecd website && bun test→ 0cd website && bun run build→ 0cd website && bun scripts/test-gallery-resume.mjs→ 0go run ./tools/changelog check→ 0go tool nsgo check -target web -jobs 4→ 0go tool nsgo test(website-only change; the full suite runs over an hour on this machine), the Android emulator, Windows, Linux and the browser jobs, and tab switching in Safari on an iPhoneRebased onto main after #2650 (zstd): the loader now hands the resumed bytes to the zstd decoder. A follow-up commit takes a body the host already decoded (
Content-Encodingset, more bytes thanContent-Length) as it comes, without storing it, as main's loader did, instead of restarting five times and failing; a test covers it.test-gallery-resume.mjsreadsconfig.stream.The author's earlier runs, on
1bf78ce29:cd website && bun test scripts/gallery-download.test.js— 11 pass, 0 fail. Covers the resumedRangeandIf-Rangeheaders, a 200 that ignores the range, a mismatchedContent-Range, a 416, a missing store, offset-order joining, cleanup after success, pause while hidden, and a stored total that differs from the build size.cd website && bun run build— exit 0 (gallery,astro checkand the site build).cd website && bun scripts/test-gallery-resume.mjs— PASS. A plain load downloads once; a dropped response then a reload asks forbytes=262144-and reaches ready; IndexedDB holds no entries afterwards.go run ./tools/changelog check— 62 fragments, exit 0.go tool nsgo check— exit 0.go tool nsgo test— 5220 pass, 2 fail on this branch. Both fail on this machine only:TestMaxRefreshRateReadsEveryMode: the display reports 0 Hz for its modes. macOS CI passes; a separate test-only pull request fixes the check.TestWebViewUnderOverlayIgnoresHoverAndCursor: fails identically on the untouched base6416e1a0b(unexpected page pointer event).A first run overlapped a local site build and timed out three GUI/SDK tests at the package level; the numbers above come from the clean rerun.
curl -r 0-1023 https://nsgo.dev/gallery/apps/app.2e60603ee6.wasm.gzipanswers 206.website.ymlbuilds only on pushes tomain, so this pull request gets no website CI. The build and the browser test ran locally on this branch.Checklist
fix(web): resume the gallery's wasm download after an interruption; a squash merge uses it as the commit subject.changelog.d/fragment, not inCHANGELOG.md.🤖 Generated with Claude Code