Skip to content

fix(error-tracking): search debug IDs progressively - #489

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
hugo.silva/rum-18038-progressive-debug-id
Aug 20, 2026
Merged

fix(error-tracking): search debug IDs progressively#489
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits into
masterfrom
hugo.silva/rum-18038-progressive-debug-id

Conversation

@jhssilva

@jhssilvajhssilva commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What does this change?

Searches built JavaScript artifacts progressively for their injected ddDebugId instead of stopping after the first 1 KiB.

  • Reads in 1 KiB chunks.
  • Stops immediately after finding a valid debug ID, so the common case still performs one read.
  • Retains a 64-character overlap so an ID split across two reads is matched.
  • Keeps memory bounded to the current chunk plus overlap.
  • If no debug ID exists, accepts reading the artifact to EOF as the rare worst case.

This is intentionally separate from the bundler-specific fixes:

  • PR #487 coordinates esbuild post-build injection with sourcemap upload.
  • PR #488 keeps Rollup injection after normal chunk transforms.

Tracking issue: RUM-18038

Validation

  • 8/8 focused tests pass.
  • Covers the one-read common case, a debug ID after the first chunk, a debug ID split across chunks, an absent debug ID that scans to EOF, and unreadable files.
  • Focused lint and Error Tracking typechecking pass.

Exact PR package matrix:

BundlerIDs extracted before uploadRuntime IDs observedResult
webpack4/42/2PASS
Vite6/62/4 loaded IDsPASS
Rollup4/42/2PASS
esbuild0/72/5 loaded IDsExpected failure without PR #487
Rspack4/42/2PASS

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.

@jhssilva
jhssilva marked this pull request as ready for review August 14, 2026 13:56
@jhssilva
jhssilva requested a review from a team as a code ownerAugust 14, 2026 13:56
@jhssilva
jhssilva requested review from buranmert and ksun154 and removed request for a teamAugust 14, 2026 13:56
@buranmert
buranmert requested a lite review from CopilotAugust 14, 2026 15:02

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

FileDescription
packages/plugins/error-tracking/src/sourcemaps/debugId.tsImplements progressive chunked scanning with overlap to find ddDebugId without reading entire bundles in the common case.
packages/plugins/error-tracking/src/sourcemaps/debugId.test.tsAdds 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.

@jhssilva

Copy link
Copy Markdown
ContributorAuthor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351Bot commented Aug 19, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-19 15:09:06 UTC ℹ️ Start processing command /merge


2026-08-19 15:09:12 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-08-19 19:13:17 UTC⚠️MergeQueue: This merge request was unqueued

devflow unqueued this merge request: It did not become mergeable within the expected time

@jhssilva

Copy link
Copy Markdown
ContributorAuthor

/code blockers

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351Bot commented Aug 20, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-20 16:25:55 UTC ℹ️ Start processing command /code blockers


2026-08-20 16:25:56 UTC ℹ️ Devflow:

Checking merge blockers for #489...


2026-08-20 16:26:02 UTC ℹ️ Devflow:/code blockers

Detected 4 merge blocker(s) to address:

🔴 Blocking

  • This pull request contains unsigned commits.
    Commits ccf807d and b2b8921 are not signed.
    Hint: Sign your commits, then force-push. See our FAQ.

🟠 Pending

@jhssilva
jhssilvaforce-pushed the hugo.silva/rum-18038-progressive-debug-id branch from 2c7d02d to 7f1e362CompareAugust 20, 2026 16:31
@jhssilva

Copy link
Copy Markdown
ContributorAuthor

/code blockers

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351Bot commented Aug 20, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-20 16:33:03 UTC ℹ️ Start processing command /code blockers


2026-08-20 16:33:04 UTC ℹ️ Devflow:

Checking merge blockers for #489...


2026-08-20 16:33:10 UTC ℹ️ Devflow:/code blockers

Detected 3 merge blocker(s) to address:

🟠 Pending

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@jhssilva@ksun154