Skip to content

fix(studio): stop 3M/day rejection flood from composition 404s#1033

Merged
miguel-heygen merged 2 commits into
mainfrom
fix/studio-rejection-flood
May 22, 2026
Merged

fix(studio): stop 3M/day rejection flood from composition 404s#1033
miguel-heygen merged 2 commits into
mainfrom
fix/studio-rejection-flood

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

@miguel-heygen miguel-heygen commented May 22, 2026

Summary

  • Filter composition asset-fetch 404s from rejection telemetry — these are content errors, not Studio bugs
  • Rate-limit error and rejection telemetry at 50 events per session to prevent any single session from flooding PostHog
  • Cache failed audio URLs in webAudioTransport so playback ticks don't re-fetch the same 404 every frame

Test plan

  • bun run --cwd packages/core build — clean
  • bun run --cwd packages/studio build — clean
  • bun run --cwd packages/core test — 984 tests pass
  • Lint + format + typecheck + fallow — all green
  • Deploy to preview, verify rejection events stop flooding PostHog
  • Verify real Studio errors still get tracked up to the 50-event cap

Two fixes for the 3M+ unhandled_promise_rejection events/day spike:

1. Filter: suppress "Error fetching ... 404" rejections from composition
   code — these are asset-not-found content errors, not Studio bugs.

2. Rate-limit: cap both error and rejection telemetry at 50 per session.
   After the cap, emit a single *_cap_reached event so we know capping
   occurred without generating unlimited events.

3. Root cause: webAudioTransport now checks response.ok before decode
   and caches failed URLs in _failedSrcs so repeat ticks don't re-fetch
   the same 404 on every playback frame.

Also add playground/ to fallow ignorePatterns — local experiment
directory was tripping the audit gate.
@miguel-heygen miguel-heygen merged commit 658e528 into main May 22, 2026
47 of 70 checks passed
@miguel-heygen miguel-heygen deleted the fix/studio-rejection-flood branch May 22, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant