fix(error-tracking): search debug IDs progressively - #489
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Error Tracking sourcemap pipeline to extract injected ddDebugId values by scanning built JavaScript artifacts progressively (in fixed-size chunks with overlap) instead of only inspecting the initial prefix, improving reliability across bundlers/transforms that may move the injected snippet later in the file.
Changes:
- Replaces prefix-only reads with a progressive 1 KiB chunk scan that stops early on match and retains a small overlap for boundary-split literals.
- Exposes the chunk size constant and adds unit tests covering early stop, later-in-file IDs, split-across-chunks IDs, scan-to-EOF, and unreadable files.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/plugins/error-tracking/src/sourcemaps/debugId.ts |
Implements progressive chunked scanning with overlap to find ddDebugId without reading entire bundles in the common case. |
packages/plugins/error-tracking/src/sourcemaps/debugId.test.ts |
Adds coverage for the progressive read behavior and related edge cases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/merge |
|
View all feedbacks in Devflow UI.
It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.
Use ⏳ Waiting for pull request to become mergeable |
What does this change?
Searches built JavaScript artifacts progressively for their injected
ddDebugIdinstead of stopping after the first 1 KiB.This is intentionally separate from the bundler-specific fixes:
Tracking issue: RUM-18038
Validation
Exact PR package matrix:
The Rollup result uses PR #489 without PR #488, confirming progressive discovery finds the entry debug ID beyond the initial 1 KiB.
The locally stacked PR #487 + PR #489 esbuild package extracted 7/7 debug IDs and observed both runtime-loaded IDs, confirming compatibility once artifact readiness is present.
All five exact PR packages also passed static production builds, deterministic rebuild checks, and browser entry/lazy registration. Staging RUM search returned zero indexed events for all generated targets during the retry window, despite successful browser intake, so this run could not revalidate downstream deobfuscation.