fix(media): stream media with ant-core 0.11.0 read-ahead (release 0.1.1) - #2
Merged
Merged
Conversation
createMediaSource now opens its reader in the core's streaming mode, which treats every read as sequential. From wherever playback starts or seeks to, the core fetches the next records in parallel, instead of stalling playback on each record's discovery. openFile keeps the conservative read-ahead of ordinary readers. The flag needs an ant-core build with read-ahead (ant-client fix/browser-media-streaming); older builds ignore it. Sync the WASM from ant-client main once that change merges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ant-client#209 merged with openPublicFile and openPrivateFile taking an
options object, `{ streaming }`, which the core deserializes as
BrowserFileReaderOptions. The SDK passed a bare boolean, written against
an earlier draft of that change. The core rejects it before any network
request ("invalid type: boolean `true`, expected struct
BrowserFileReaderOptions"), so with a WASM synced from main every
openFile() and createMediaSource() call would fail.
Type the argument as RawFileReaderOptions, mirroring the core struct, and
pass `{ streaming }`. Builds without read-ahead ignore the argument.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rebuild the bundled WASM with `npm run sync:wasm` from a clean checkout of ant-client main db85c72 (rustc 1.96.1, wasm-pack 0.15.0). It brings: - read-ahead for sequential and streaming range reads (ant-client#209), which the SDK's media sources use, bounded by records and a per-client held-record budget; - six peers per browser lookup round (ant-client#211); - reads from holders that discovery offers after the early allowance; - pointer bindings, which the SDK does not expose. A new boundary test checks that the packaged core accepts the reader options the SDK passes and rejects a bare boolean. The README states when openFile() readers read ahead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SDK checks, a paid seven-node devnet run in real Chromium, and mainnet media playback against the published 0.1.0, with probes, logs and checksums. 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.
Linear issue
Closes V2-1355
Summary
Media playback no longer stalls while records are discovered. This PR ships SDK 0.1.1 with ant-core 0.11.0 from ant-client main.
createMediaSourceopens a streaming reader. With the read-ahead core from fix(browser): keep media playback streaming while records are discovered ant-client#209, playback fetches the next records in parallel from wherever it starts or seeks to.openFilekeeps ordinary readers, which read ahead only once a read continues a previous one.db85c72(ant-core 0.11.0) withnpm run sync:wasm. Besides read-ahead (#209), the new core queries six peers per browser lookup round (#211) and reads from holders that discovery finds after the early allowance. It also includes pointer bindings, which the SDK does not expose.openPublicFile/openPrivateFiletaking an options object,{ streaming }, but this PR's first commit passed a bare boolean. Against the new core, everyopenFile()andcreateMediaSource()would have failed withinvalid type: boolean `true`, expected struct BrowserFileReaderOptions. The SDK now passes{ streaming: false | true }. A new boundary test runs that against the packaged WASM, because the mocked client tests could not catch it.docs/audits/2026-10-01-ant-core-0.11-sync.md.Commits, in bisectable order: the call-shape fix works with both the old and new WASM; then the sync, the version bump, and the audit.
Risk tier
Client-only: no node, wire, storage or payment change. The core's read-ahead and wider lookup rounds change how many requests a browser sends in parallel; ant-client's ADR-0004 records them. A paid devnet run is included anyway.
Compatibility
openPublicFile/openPrivateFilecalls pass an optional third argument,{ streaming }.Semver impact
Test evidence
Full details, probes, logs and checksums are in
docs/audits/2026-10-01-ant-core-0.11-sync.md.npm run check: build, typecheck and 188/188 tests, including the new reader-options boundary test.npm run verify:wasmpassed for ant-clientdb85c72on main (WASM sha2568fa35e58…).npm run build:examples: 5/5 built.npm pack --dry-run: 89 files, 2.2 MB. ADR governance passed. CI is green.Paid devnet, real Chromium: seven nodes at ant-node
c092f22(ant-client's browser CI pin) and local Anvil.openFileandcreateMediaSourceranges matched for both files. There were no page or console errors.Mainnet, Chromium, on the 612 MB video
134e4537…a889, with the same probe on both builds:openFilestart, middle and end reads returned correct bytes. On startup timing, both builds connected in about 2 s and reached chunk 3/147 within the same range.Not caused by this change: on the 7-node devnet, a second large upload in the same page fails with "insufficient peers". Published 0.1.0 fails identically (0/4 for both builds). It is recorded in the audit for a separate issue.
New dependency
none
ADR
n/a
Mitigation / rollback
Deprecate 0.1.1 on npm and point users at 0.1.0, or revert this PR and release 0.1.2. Reverting only the media commit returns media sources to ordinary readers, which still read ahead after sequential reads.
🤖 Generated with Claude Code