Skip to content

feat(core): Report cellular network technology - #6827

Merged
alwx merged 5 commits into
mainfrom
alwx/feature/4256
Oct 7, 2026
Merged

alwx merged 5 commits into
mainfrom
alwx/feature/4256

Conversation

@alwx

@alwx alwx commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

📢 Type of change

  • New feature

📜 Description

Events now report the generation of the cellular network technology in device.connection_effective_type on Android and iOS, for example 4g or 5g.

The native SDKs produce the field, and this SDK passes it on without code changes. On iOS, sentry-cocoa 9.30.0 adds it to the extra context that fetchNativeDeviceContexts merges into the device context. On Android, sentry-java 8.60.0 (getsentry/sentry-java#6146) adds it to the device context that serializeScope returns.

This pull request must merge after the bump to sentry-android 8.60.0.

💡 Motivation and Context

Closes #4256

💚 How did you test it?

A unit test in devicecontext.test.ts makes sure that both fields reach the event device context from the native layer.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • All tests passing.
  • No breaking changes.

🤖 Generated with Claude Code

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>
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

⚪ None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


  • feat(core): Report cellular network technology by alwx in #6827
  • test(e2e): Re-enable iOS view_names assertion in captureMessage test by antonis in #6846
  • fix(core): Strip callback options before the native SDK starts by alwx in #6847
  • fix(android): Resolve @sentry/react-native from rootDir in Expo plugin by alwx in #6840
  • chore: Clean up non-actionable TODOs by antonis in #6843
  • chore(deps): update JavaScript SDK to v10.76.0 by antonis in #6831
  • chore(expo): bump sample to Expo 57.0.26 by antonis in #6838
  • chore(deps): Bump basic-ftp to 6.2.2 by alwx in #6837
  • fix(core): Mark package as side-effect free by devclaimjuimperai in #6829
  • chore(deps): bump getsentry/craft/.github/workflows/changelog-preview.yml from 2.31.0 to 2.33.1 by dependabot in #6833
  • chore(deps): bump gradle/actions/setup-gradle from 6.3.0 to 6.4.0 by dependabot in #6834
  • chore(deps): bump getsentry/craft from 2.31.2 to 2.33.1 by dependabot in #6835
  • chore(deps): bump getsentry/github-workflows/validate-pr from 4013fc6e1aeb1be1f9d3b4d232624f0ec1afa613 to 36c729264d2edc29ebae61950c50e1e9f043ad7e by dependabot in #6832
  • fix(android): Settle initNativeReactNavigationNewFrameTracking promise by antonis in #6823
  • fix(spotlight): Forward image attachments to Spotlight by antonis in #6818
  • fix(ios): Prevent crash when initialized with an invalid DSN by antonis in #6825
  • chore(core): Resolve non-actionable TODOs by antonis in #6826
  • chore(core): resolve stale TODO comments by antonis in #6819
  • fix(profiling): Populate Hermes runtime version on JS profiles by antonis in #6817

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against b1dc30e

@alwx
alwx marked this pull request as ready for review October 2, 2026 12:52
@alwx

alwx commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

@antonis this one is practically ready and will work automatically once Android releases a new version (iOS released it already). I wonder what you think of this PR — there is really no work needs to be done on our side (except for a test), and I feel like we could either merge this now or wait until the next Android release. Wdyt?

@antonis antonis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 🎉

Happy to approve and leave the merge to you.
I would advocate on keeping this unmerged to test on a device after the Android bump and avoid unnecessary reverts if our 8.30.0 ships before Android 8.60.0 is available.

@alwx

alwx commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

let's wait before Android gets released later this week

…ve 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>
@alwx alwx changed the title feat(android): Report cellular network technology feat(core): Report cellular network technology Oct 7, 2026
alwx and others added 2 commits October 7, 2026 10:03
…d iOS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
contexts: expect.objectContaining({
device: expect.objectContaining({
arch: expect.any(String),
connection_type: expect.any(String),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The iOS e2e test incorrectly asserts that the optional connection_type field is always present, which can lead to flaky test failures.
Severity: LOW

Suggested Fix

The assertion for connection_type should be updated to handle cases where the field is absent. Instead of expect.any(String), consider a more flexible matcher that accepts either a string or an undefined value to align with the native SDK's behavior and prevent flaky test failures.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: samples/react-native/e2e/tests/captureMessage/captureMessage.test.ios.ts#L61

Potential issue: The iOS end-to-end test at `captureMessage.test.ios.ts:61` adds a
strict assertion for `connection_type: expect.any(String)`. However, the underlying
`sentry-cocoa` SDK documentation specifies that the `connection_type` field is optional
and will be omitted if the connection is unknown. This discrepancy will cause the test
to fail when the SDK legitimately omits this field, a plausible scenario in CI
environments due to timing or network conditions. This makes the test flaky and
unreliable.

Did we get this right? 👍 / 👎 to inform future reviews.

@alwx
alwx enabled auto-merge (squash) October 7, 2026 08:37
@alwx
alwx merged commit 8cae3b5 into main Oct 7, 2026
58 of 74 checks passed
@alwx
alwx deleted the alwx/feature/4256 branch October 7, 2026 08:41
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.

Connection Type to include Cellular Network Technology (e.g. 3G, 4G LTE, 5G)

2 participants