Wrong value in "In Foreground" for every sentry event
ljql2001 opened this issue · 1 comments
Platform
iOS
Environment
Develop
Installed
CocoaPods
Version
8.24.0
Did it work on previous versions?
I don't know. We are starting at this version.
Steps to Reproduce
When app enters background and foreground, the context[@"app"][@"in_foreground"] field is wrong in every event.
The value seems to remain the same value no matter it is YES or NO since app starts.
As I debug the codes, this issue seems to come from LN 634 in SentryClient.m: SentryAppState *appState = [manager loadPreviousAppState];
Expected Result
The value of context[@"app"][@"in_foreground"] field is correct when app enters background and foreground.
Actual Result
The value seems to remain the same value no matter it is YES or NO since app starts.
Are you willing to submit a PR?
No
That's a good catch thanks. The culprit is here
sentry-cocoa/Sources/Sentry/SentryClient.m
Lines 633 to 635 in 2b9e267
This is an easy fix.