fix(session-replay-browser): prevent worker script load failure from blob URLs#1522
Conversation
Handle web worker failures in
|
Handle web worker initialization failures in
|
…blob URLs Disabled sourcemaps in worker bundle to prevent importScripts failures when loading worker from blob URLs. Added error handling to gracefully fall back to non-worker compression if worker creation or execution fails. The worker build was generating sourcemap references that couldn't be resolved in blob URL contexts, causing NetworkError when the worker tried to load them. Co-authored-by: Cursor <cursoragent@cursor.com>
490bc8e to
ac98235
Compare
Summary
Disabled sourcemaps in worker bundle to prevent importScripts failures when loading worker from blob URLs. Added error handling to gracefully fall back to non-worker compression if worker creation or execution fails.
The worker build was generating sourcemap references that couldn't be resolved in blob URL contexts, causing NetworkError when the worker tried to load them.
Not sure of the best way to repro this, but hopefully we can follow the initial sentry issue.
Checklist
Note
Low Risk
Build config and defensive error-handling changes with a clear fallback path; primary risk is reduced worker debugging due to disabled sourcemaps.
Overview
Prevents session replay compression web workers from failing when loaded from blob URLs by disabling sourcemaps for the inlined worker bundle generation.
Hardens
EventCompressorweb worker usage by wrapping worker creation intry/catchand, on worker runtime error, terminating the worker and falling back to in-thread compression; adds a unit test coveringWorkerconstructor failure fallback.Written by Cursor Bugbot for commit ac98235. This will update automatically on new commits. Configure here.