Skip to content

[RUM-20338] feat: Add Vega crash reporting and app metadata - #1581

Open
cdn34dd wants to merge 2 commits into
carlosnogueira/RUM-20337/add-vega-logging-and-user-account-contextfrom
carlosnogueira/RUM-20338/add-vega-crash-reporting-and-app-metadata
Open

cdn34dd wants to merge 2 commits into
carlosnogueira/RUM-20337/add-vega-logging-and-user-account-contextfrom
carlosnogueira/RUM-20338/add-vega-crash-reporting-and-app-metadata

Conversation

@cdn34dd

@cdn34dd cdn34dd commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Adds crash-reporting and app-metadata support to the Vega package.

  • Includes the native crash backend and a setup helper that registers it only when RUM is configured and native crash reporting is enabled.
  • Lets the shared JavaScript error tracker report through Vega. Fatal reporting settles before the app's crash handler runs. Non-fatal reports have a timeout, and reporting failures still reach the app's existing handlers.
  • Adds the bundle Debug ID and React Native source type to RUM errors and logs with error details.
  • Reads default service and app version values from platform metadata, respects overrides and version suffixes, and keeps the SDK version separate.

Motivation

Vega apps need native crashes and JavaScript errors that can be matched to source maps and the correct app version. This adds the support covered by RUM-20338.

Additional Notes

Stacked on #1579.

Initialization wiring remains in RUM-20335. This PR provides and documents the configuration helpers that initializer must call. Native crash reporting is disabled by default and is a setup-time setting, not a runtime toggle.

The shared error-handler changes also apply to core consumers on iOS and Android, including Expo. The default core reporter is retained.

QA completed:

  • yarn test --runInBand --watchman=false: 2,024 tests passed; one skipped.
  • yarn lint: no errors; 12 existing warnings.
  • yarn prepare: all 11 package builds and TypeScript checks passed.
  • Timing regression tests use the real crash-context delay. They cover slow fatal success and rejection, non-fatal stalls, and console calls during the delay. The fatal tests also fail against the previous implementation.
  • Four native host tests passed, including actual SDK crash-handler registration.
  • Native library builds passed for aarch64, armv7, and x86_64.
  • yarn workspace @datadog/mobile-react-native-vega pack --dry-run --json: the new native and JavaScript files are included.

Device crash delivery, source-map symbolication, and Expo smoke testing have not been run. After initialization is connected, verify crash reporting in separate app launches with the setting disabled and enabled, and check that JavaScript errors resolve against the uploaded source map.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@cursor cursor Bot 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.

PR Review — Quality: 3.0 / 5 · Review load: Broad (~1.5–2h)

This PR needs another look before merge. It adds Vega crash-registration and app-metadata hooks, and it changes shared JavaScript error handling for every app that enables trackErrors. A fatal error can reach the previous handler before addError finishes, so the existing crash-context delay no longer starts from a completed native update. Vega registration stays gated, and initialization remains deferred to RUM-20335.

Customer impact: Medium — apps with rumConfiguration.trackErrors enabled on iOS, Android, and Expo can lose the JavaScript crash context on a fatal error when native addError is still in flight after 50ms. Vega native crash capture stays off unless nativeCrashReportEnabled is set and the later initializer calls configureCrashReporting.

Concern
Shared JS error-handler timing (DdRumErrorTracking) Risky
Vega native crash backend and registration gate Risky
Service, version, and error symbolication attributes Risky

Assessment: The fatal-handler race is the defect that holds this below a merge. reportSafely is covered for thrown, rejected, and never-resolving reporters, but the stall test mocks executeWithDelay, so it does not keep the crash delay behind a settled addError. Vega crash registration refuses a missing core, disabled or non-boolean settings, an invalid application id, and a second registration; the host test asserts the SIGSEGV disposition changes only on the enabled path. buildApplicationMetadata covers platform defaults, overrides, a single suffix, and unavailable device info. The pinned tree does not include dd-sdk-cpp, so this review uses that host test as the contract for CrashReporting::Register and does not assess the backend implementation.

Review load — Broad (~1.5–2h): The effort is the core fatal-error ordering, the Vega signal-handler gate, and the metadata and symbolication attributes. Review them together: the ordering change already affects existing trackErrors apps, and the Vega hooks are the callers that depend on it.

Findings

  • [Blocking · Correctness] Fatal handler runs before addError settles — reportSafely continues the fatal path at 50ms while addError is still pending. Inline on packages/core/src/rum/instrumentation/DdRumErrorTracking.tsx.
Open in Web View Automation 

Sent by Cursor Automation: dd-sdk-react-native reviews

@cdn34dd
cdn34dd added this pull request to stack #1580 November 26, 2026 09:29

@cursor cursor Bot 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.

PR Review — Quality: 5.0 / 5 · Review load: Broad (~1.5–2h)

Quality moved from 3.0 because the fatal-handler race is fixed. This PR is ready to merge as-is. Fatal addError now settles before the 50ms crash-context delay and the previous error handler, and non-fatal and console reporting still give up after 50ms. The timing tests use the real executeWithDelay, and the Vega README matches that contract.

Customer impact: Medium — apps with rumConfiguration.trackErrors enabled on iOS, Android, and Expo bound non-fatal and console reporting, while fatal JavaScript errors wait for native reporting before the existing crash handler. Vega native crash capture stays off unless nativeCrashReportEnabled is set and the later initializer calls configureCrashReporting.

Concern
Shared JS error-handler timing (DdRumErrorTracking) Risky
Vega native crash backend and registration gate Risky
Service, version, and error symbolication attributes Risky

Assessment: reportSafely waits out a fatal reporter, including rejection and a synchronous throw, then starts the crash delay with isInDefaultErrorHandler set only around the previous handler. A fatal addError that never settles still withholds that handler; that is the pre-PR .then chain and the behavior requested on the previous thread. The core, Android, iOS, and Vega addError paths read here resolve the bridge promise. The new tests keep the real delay and cover a slow fatal success and rejection, console calls during the wait, and a stalled non-fatal or console report. The unchanged crash-registration and metadata work stays as covered in the previous full review.

Review load — Broad (~1.5–2h): The effort is still the shared fatal-error ordering, the Vega signal-handler gate, and the metadata and symbolication attributes. Review them together: the ordering change affects existing trackErrors apps, and the Vega hooks are the callers that depend on it.

This run assessed the delta since 400543bc and revalidated the prior finding. That thread is addressed: #1581 (comment)

Open in Web View Automation 

Sent by Cursor Automation: dd-sdk-react-native reviews

@cdn34dd
cdn34dd marked this pull request as ready for review November 26, 2026 11:28
@cdn34dd
cdn34dd requested review from a team as code owners November 26, 2026 11:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T11:30:12.178095Z df00f6d Draft marked ready
🔒 Security Review ✅ Completed 2026-11-26T11:33:00.786634Z df00f6d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-official datadog-official Bot 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.

Bits Code Review: PASS

More details

The shared error handler preserves delegation when reporting throws or rejects, while fatal errors wait for reporting before the crash-context delay. Device crash delivery, symbolication, and Expo behavior remain unverified.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit df00f6d

This branch has not been deployed

No deployments
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