Skip to content

Commit 8cae3b5

Browse files
alwxclaude
andauthored
feat(core): Report cellular network technology (#6827)
* feat(android): Report cellular network technology The Android SDK reports the generation of the cellular network technology in device.connection_effective_type from sentry-java 8.60.0. The field reaches events through serializeScope, so this SDK only has to bundle that version. iOS already reports the field, because sentry-cocoa 9.30.0 puts it into the extra context that fetchNativeDeviceContexts merges into the device context. The tests guard the path from the native layer to the event. The version bump follows when sentry-java 8.60.0 is released. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * feat(android): Read the cellular network technology in the React Native layer sentry-android 8.60.0 is not released yet. The module now fills device.connection_effective_type when sentry-android does not set it. After the bump, this fallback has no effect and can be removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Revert "feat(android): Read the cellular network technology in the React Native layer" This reverts commit c94e729. * docs(changelog): Report the cellular network technology on Android and iOS Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 6ce1083 commit 8cae3b5

3 files changed

Lines changed: 19 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
99
## Unreleased
1010

11+
### Features
12+
13+
- Report the generation of the cellular network technology in `device.connection_effective_type` on Android and iOS, for example `4g` or `5g` ([#6827](https://github.com/getsentry/sentry-react-native/pull/6827))
14+
- On Android 11 and earlier, the app must have the `READ_PHONE_STATE` permission. The SDK does not request this permission.
15+
1116
### Fixes
1217

1318
- Fix stale `turbo_module.*` tags on Android native crashes ([#6823](https://github.com/getsentry/sentry-react-native/pull/6823))

‎packages/core/test/integrations/devicecontext.test.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ describe('Device Context Integration', () => {
9393
});
9494
});
9595

96+
it('adds the native connection type and technology to the device context', async () => {
97+
const { processedEvent } = await processEventWith({
98+
nativeContexts: {
99+
contexts: { device: { connection_type: 'cellular', connection_effective_type: '5g' } },
100+
},
101+
});
102+
expect(processedEvent).toStrictEqual({
103+
contexts: {
104+
device: { connection_type: 'cellular', connection_effective_type: '5g' },
105+
},
106+
});
107+
});
108+
96109
it('merge native tags', async () => {
97110
const { processedEvent } = await processEventWith({
98111
nativeContexts: { tags: { duplicate: 'native-tag', native: 'tag' } },

‎samples/react-native/e2e/tests/captureMessage/captureMessage.test.ios.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ describe('Capture message', () => {
5858
contexts: expect.objectContaining({
5959
device: expect.objectContaining({
6060
arch: expect.any(String),
61+
connection_type: expect.any(String),
6162
family: expect.any(String),
6263
free_memory: expect.any(Number),
6364
locale: expect.any(String),

0 commit comments

Comments
 (0)