Repository navigation
[RUM-20338] feat: Add Vega crash reporting and app metadata - #1581
Conversation
There was a problem hiding this comment.
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 —
reportSafelycontinues the fatal path at 50ms whileaddErroris still pending. Inline onpackages/core/src/rum/instrumentation/DdRumErrorTracking.tsx.
Sent by Cursor Automation: dd-sdk-react-native reviews
There was a problem hiding this comment.
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)
Sent by Cursor Automation: dd-sdk-react-native reviews
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit df00f6d


What does this PR do?
Adds crash-reporting and app-metadata support to the Vega package.
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.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)