NFR-052: network-hermetic mount — disable Blockly workspace sounds - #18
Conversation
main's agentic-checks/tests job failed on the last two merge pushes with 8 unhandled "fetch failed" rejections. Root cause: mountBlockly passed no media/sounds option, so Blockly's WorkspaceAudio preloaded its four UI sounds from the DEFAULT media path — https://static.blockly.com/media/ — on every jsdom mount (geometry/density corpus harnesses). The CI error's IPs resolve to exactly that domain; on the runners the CDN timed out, and Vitest treats the late rejections as a failed run. PR runs passed only because the CDN happened to respond. Beyond CI, an embeddable component must not silently call a third-party CDN from the host page. SPEC-first: NFR-052 appended to §8.8 (network-hermetic mount, sounds disabled — the audio preload is the media path's only consumer in our surface); id-ledger +1; traceability row. Red-first: packages/editor-ui/test/hermetic-mount.test.ts mounts with a rejecting fetch spy — pre-fix it failed with the exact CI signature (4 unhandled sound fetches); post-fix zero fetches and hasSounds === false. Fix: sounds: false in mountBlockly's inject options. Verified with a fetch logger across the geometry + density corpus suites: zero network calls. Refs: NFR-052 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesNetwork-Hermetic Blockly Mount
Corpus Test Timing
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant HermeticMountTest
participant mountBlockly
participant BlocklyInject
participant FetchSpy
HermeticMountTest->>mountBlockly: mount workspace
mountBlockly->>BlocklyInject: inject with sounds false
BlocklyInject-->>FetchSpy: no external fetch request
HermeticMountTest->>BlocklyInject: assert hasSounds is false
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
The RFC-008 re-pin grew the docs corpus 121 → 163 examples; the NFR-049/050 corpus sweeps now measure 98–120s on CI runners (main 98.6s, PR#17 112.3s, PR#18 120.3s — the last hit the 120s per-test ceiling exactly, on runner variance alone). Headroom over the measured band, not license to slow down: local runs stay ~13s and the empty-palette mount keeps the per-run cost. Refs: NFR-049 NFR-050 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
=======================================
Coverage 78.45% 78.46%
=======================================
Files 38 38
Lines 2906 2907 +1
Branches 464 464
=======================================
+ Hits 2280 2281 +1
Misses 598 598
Partials 28 28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Problem
agentic-checks / testshas been red on the last twomainpushes (post-#16 and post-#17 merges) with 8 unhandledfetch failed / ETIMEDOUTrejections — while the same commits passed their PR runs and every test passes locally.Root cause:
mountBlocklypasses nomedia/soundsoption, so Blockly falls back to its default media path andWorkspaceAudiopreloads four UI sounds fromhttps://static.blockly.com/media/on every workspace inject (the jsdom geometry/density corpus harnesses mount repeatedly). The failing IPs (104.21.58.119/172.67.159.107) resolve to exactlystatic.blockly.com; reproduced locally with a--requirefetch logger (click/delete/disconnect/drop.mp3). On the runners the CDN timed out, the rejections landed after tests completed, and Vitest fails the run on unhandled errors. PR runs were green only because the CDN happened to respond.Change (SPEC-first)
static.blockly.comnever fetched; workspace sounds disabled (the audio preload is the media path's only consumer in our surface). Beyond CI, an embeddable component (NFR-043) must not silently call a third-party CDN from the host page.sounds: falseinmountBlockly's inject options (mount.ts) — one line plus rationale comment.Tests
Red-first:
packages/editor-ui/test/hermetic-mount.test.tsmounts with a rejecting fetch spy — pre-fix it failed with the exact CI signature (1 failed test + 4 unhandled sound-fetch errors); post-fix zero fetch calls andworkspace.options.hasSounds === false.Verification
geometry-corpus+density-corpus(the suites Vitest attributed the CI rejections to): zero network calls.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests
Documentation