Skip to content

Conversation

@ccschmitz-launchdarkly
Copy link
Contributor

@ccschmitz-launchdarkly ccschmitz-launchdarkly commented Oct 3, 2025

Summary

Updates our logic for unhandled promise rejections:

  • Ties into the HermesInternal.enablePromiseRejectionTracker hook for setting up a handler.
  • Removes our filtering of network request errors in our old promise rejection handler.
  • Adds specific support for Axios errors.
  • Adds axios to our E2E app + some UI for testing requests with different status codes.

How did you test this change?

Click tested in the RN demo app: https://www.loom.com/share/a6097e43c137463fa9d1c6c6cc94895a

Are there any deployment considerations?

Follow up with Axios customers who have mentioned not seeing errors for failed requests.

JIRA Issue: https://launchdarkly.atlassian.net/browse/O11Y-586


Note

Switches unhandled promise rejection handling to Hermes tracker, adds Axios-aware error extraction, updates the demo app with Axios test actions, and expands tests.

  • SDK (observability-react-native):
    • Unhandled Rejections: Integrates HermesInternal.enablePromiseRejectionTracker and removes Promise monkey-patching; stops filtering network errors; uses extractRejectionDetails to enrich attributes (Axios/fetch/primitives/objects).
    • Console Handling: Captures only console.error (drops console.warn capture); simplifies attributes.
    • Utilities: Adds extractRejectionDetails (Axios/fetch/primitives/object parsing); removes isNetworkError checks.
    • Mocks: Adds ErrorUtils and Vitest vi to RN mock.
  • Tests:
    • New/expanded tests for unhandled rejections (Hermes callbacks), Axios errors, primitives/objects, and utilities; updates cleanup expectations.
  • E2E App (react-native-otel):
    • Adds Axios dependency and UI buttons to trigger success/404/500 requests with new button styles.
    • Removes custom global error/promise/fetch handlers from _layout.tsx.
  • Dependencies:
    • Adds axios to app and SDK dev deps; updates yarn.lock.

Written by Cursor Bugbot for commit 72d8e09. This will update automatically on new commits. Configure here.

@ccschmitz-launchdarkly ccschmitz-launchdarkly changed the title Add axios example to E2E app Update RN unhandled promise rejection handling Oct 7, 2025
@ccschmitz-launchdarkly ccschmitz-launchdarkly changed the title Update RN unhandled promise rejection handling feat: update unhandled promise rejection handling Oct 8, 2025
@ccschmitz-launchdarkly ccschmitz-launchdarkly marked this pull request as ready for review October 8, 2025 18:55
@ccschmitz-launchdarkly ccschmitz-launchdarkly requested a review from a team as a code owner October 8, 2025 18:55
cursor[bot]

This comment was marked as outdated.

@ccschmitz-launchdarkly ccschmitz-launchdarkly enabled auto-merge (squash) October 13, 2025 14:18
Copy link
Contributor

@SpennyNDaJets SpennyNDaJets left a comment

Choose a reason for hiding this comment

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

LGTM

@ccschmitz-launchdarkly ccschmitz-launchdarkly merged commit bd0321c into main Oct 14, 2025
21 checks passed
@ccschmitz-launchdarkly ccschmitz-launchdarkly deleted the rn-axios-testing branch October 14, 2025 14:24
Vadman97 pushed a commit that referenced this pull request Oct 15, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>observability-react-native: 0.7.0</summary>

##
[0.7.0](observability-react-native-0.6.0...observability-react-native-0.7.0)
(2025-10-15)


### Features

* update unhandled promise rejection handling
([#260](#260))
([bd0321c](bd0321c))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Release @launchdarkly/observability-react-native 0.7.0 with updated
unhandled promise rejection handling and corresponding manifest/version
updates.
> 
> - **SDK (@launchdarkly/observability-react-native) — 0.7.0**
>   - *Feature*: update unhandled promise rejection handling.
> - Bump version in
`sdk/@launchdarkly/observability-react-native/package.json`.
>   - Update `.release-please-manifest.json` entry.
>   - Add `CHANGELOG.md` entry for 0.7.0.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
45e1d87. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

2 participants