Repository navigation
fix: boot early only on ready, not on an answer from the whole archive - #33
Merged
Merged
Conversation
On a host without Range the element indexes on every progress report and boots early when the answer allows. Only a partial index carries `ready`, decided by the dependency walk; once the download is whole the worker answers from the central directory with no `ready` and no walk, and the element booted on that answer because it checked `ready !== false`. The runtime then raced the library bundle's attachment for the missing library.json: 1 or 2 plays in 30 failed in WebKit. Any answer but `ready: true` now waits for the final index. Closes #32. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #32.
On a host without
Range, the element boots early only when the worker answersready: true. Before, it booted on any answer that didn't sayready: false. That included the answer the worker gives once the download is whole: from the central directory, with noreadyand no dependency walk. So the frame could boot before the final index had attached the library bundle, and the runtime got a 404 for the missinglibrary.json.Change
packages/player/src/h5p-offline-player.ts, indownloadAndIndex:partialandreadyentered the protocol together (10137a1, 2026-09-28), so every worker that can say a partial index is ready says so withtrue. The finaldeepindex, which runs anyway once the download ends, supplies the libraries and boots the frame.Evidence
Each probe was 30 plays of the unpaced
/no-range/needs-dependency.h5pwithlibraries, each under its own URL (temporary probe, not committed):partialandreadyboth undefinedA content-only export from a host without
Rangewas never exposed: 0 failures in 10 per engine on the old code, with the same states as the fix. The plain index refuses a package missing a library itsh5p.jsondeclares, so there's nothing to boot on. Only packages whose own libraries need one they don't carry are affected, which is #18's case.Test
libraries.test.tsgains "boots a whole download only after the final index has supplied what its libraries need". It pins the states of the unpaced load:probing → downloading → indexing → downloading → indexing → ready, withindexingbetween the package's download and the bundle's. On the old condition the element had already booted, so the bundle'sdownloadingmerged into the package's and the test fails deterministically (checked as a control), not 1 time in 30.Testing
browser-emulated)AGENTS.md: the early-boot paragraph under the dependency walk invariant now covers this.
Release
Player patch, 0.9.4. The runtime and embed don't change. Embed 0.6.2 accepts
^0.9.3, so a player domain gets this when its site is written again.🤖 Generated with Claude Code