Skip to content

iOS Device and OS Context missing after upgrade to v3 (Native context not merging) #1151

@mmorandini

Description

@mmorandini

Environment

Angular: 21.x

Ionic: 8.7.11

Capacitor: 8.x

@sentry/angular: 10.40.0

@sentry/capacitor: 3.1.0

Sentry-Cocoa (Native): 9.3.0 (verified via Podfile.lock)

Steps to Reproduce

Initialize Sentry using the "dual-init" pattern: SentryCapacitor.init({ ... }, SentryAngular.init).

Throw a test error from an Angular component.

Inspect the event payload in the Sentry Dashboard.

Expected Result

The contexts object should contain a populated os block and high-level device metadata (e.g., family, model, brand) as it did in v2.

Actual Result

The os context is entirely missing. The device context contains only low-level web-accessible metrics (battery level, orientation, thermal state), but identifying information is absent.

Supporting Evidence (Internal Payload)

Inspecting the raw JSON for a recent event reveals:

"contexts": {
    "device": {
      "battery_level": 100,
      "orientation": "landscape",
      "thermal_state": "nominal"
      // MISSING: family, model, brand
    },
    // MISSING: "os" context object
    "trace": { ... }
}

However, the sdk info confirms that both the Capacitor and Cocoa integrations are registered:

sentry.cocoa.capacitor: 9.3.0

npm:@sentry/capacitor: 3.1.0

npm:@sentry/angular: 10.40.0

Additional Context

The platform tag in the event is reported as "javascript".

Manually calling Sentry.getNativeDeviceContext() in the app returns the high-level info correctly, suggesting the bridge itself is functional, but the data is not being attached/merged to the automatic Angular error events during the beforeSend or enrichment phase.

Metadata

Metadata

Labels

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions