Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLAT-12474] Support error correlation property in events #2174

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [8.0.0] - Unreleased

### Added

- (delivery-react-native) Support error correlation properties in event payloads [#2174](https://github.com/bugsnag/bugsnag-js/pull/2174)

### Fixed

- (plugin-angular) Prevent excess change detection cycles when calling `Bugsnag.notify` [#1861](https://github.com/bugsnag/bugsnag-js/pull/1861)
Expand Down
3 changes: 2 additions & 1 deletion packages/delivery-react-native/delivery.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ module.exports = (client, NativeClient) => ({
groupingHash: event.groupingHash,
apiKey: event.apiKey,
featureFlags: event.toJSON().featureFlags,
nativeStack: nativeStack
nativeStack: nativeStack,
correlation: event._correlation
}

if (isTurboModuleEnabled) {
Expand Down
3 changes: 3 additions & 0 deletions packages/delivery-react-native/test/delivery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type NativeClientEvent = Pick<EventWithInternals,
severityReason: EventWithInternals['_handledState']['severityReason']
user: EventWithInternals['_user']
metadata: EventWithInternals['_metadata']
correlation: EventWithInternals['_correlation']
nativeStack: NativeStackIOS | NativeStackAndroid
}

Expand Down Expand Up @@ -57,6 +58,7 @@ describe('delivery: react native', () => {
c.setContext('test screen')
c.setUser('123')
c.notify(new Error('oh no'), (e) => {
e.setTraceCorrelation('trace-id', 'span-id')
e.groupingHash = 'ER_GRP_098'
e.apiKey = 'abcdef123456abcdef123456abcdef123456'
}, (err, event) => {
Expand All @@ -80,6 +82,7 @@ describe('delivery: react native', () => {
expect(sent[0].metadata).toEqual({})
expect(sent[0].groupingHash).toEqual('ER_GRP_098')
expect(sent[0].apiKey).toBe('abcdef123456abcdef123456abcdef123456')
expect(sent[0].correlation).toEqual({ traceId: 'trace-id', spanId: 'span-id' })
done()
})
})
Expand Down
Loading