Skip to content

Missing device info on watchdog_termination events #5182

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

Open
dalnoki opened this issue May 6, 2025 · 4 comments · May be fixed by #5242
Open

Missing device info on watchdog_termination events #5182

dalnoki opened this issue May 6, 2025 · 4 comments · May be fixed by #5242
Assignees

Comments

@dalnoki
Copy link

dalnoki commented May 6, 2025

Platform

iOS

Environment

Production

Installed

Swift Package Manager

Version

8.48

Xcode Version

16.2

Did it work on previous versions?

No response

Steps to Reproduce

Since approximately April 14, 2025, Sentry has stopped capturing device context (e.g. OS, model, OS version) on watchdog_termination events in a particular project of the customer. All other event types for the same device continue to show full device information as expected.

Additional details can be found in the internal Jira ticket.

Expected Result

Device context should be populated as it did before.

Actual Result

The Device section is completely empty for watchdog_termination events.

Are you willing to submit a PR?

No response

@philipphofmann
Copy link
Member

I can easily reproduce this. When I trigger an OOM crash in the sample app, it also misses device info: https://sentry-sdks.sentry.io/issues/3808632822/events/672779b675c146649bad521c960a74f4/?project=5428557

I think this is related to fixing wrongly applying the scope: #4969. So the device previously could have been wrong. We need to sync the scope here

- (void)setContext:(nullable NSDictionary<NSString *, id> *)context
{
// Left blank on purpose
}
- (void)setDist:(nullable NSString *)dist
{
// Left blank on purpose
}
- (void)setEnvironment:(nullable NSString *)environment
{
// Left blank on purpose
}
- (void)setExtras:(nullable NSDictionary<NSString *, id> *)extras
{
// Left blank on purpose
}
- (void)setFingerprint:(nullable NSArray<NSString *> *)fingerprint
{
// Left blank on purpose
}
- (void)setLevel:(enum SentryLevel)level
{
// Left blank on purpose
}
- (void)setTags:(nullable NSDictionary<NSString *, NSString *> *)tags
{
// Left blank on purpose
}
- (void)setUser:(nullable SentryUser *)user
{
// Left blank on purpose
}
- (void)setTraceContext:(nullable NSDictionary<NSString *, id> *)traceContext
{
// Left blank on purpose
}
and then apply it similar to what already do with breadcrumbs.

@gabriellanata
Copy link
Contributor

Also experiencing this issue where we have lost all data on watchdog termination events.

Image

@philprime
Copy link
Contributor

Thanks @gabriellanata for the comparison!

@kahest @philipphofmann we might have to bump the priority from high to urgent.

@philprime philprime self-assigned this May 16, 2025
@philprime
Copy link
Contributor

Couple of insights from my investigation:

  • As @philipphofmann already mentioned, we need to implement the observer persisting data to disk
  • The SentryWatchdogTerminationScopeObserver is installed by the watchdog termination tracking integration after the contexts of the scope are set → setContext is not triggered.
  • We need to trigger a manual sync of the scope to the observer on install

Working on a draft PR now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants