You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a notification exposed for hybrid SDKs which they're supposed to call when an app becomes active (SentryHybridSdkDidBecomeActive). This is because if the app was already active at the time the normal DidBecomeActive notification is registered, it would never get triggered.
The problem with this solution is that it shifts the issues to all individual consuming SDKs (which is bound to fail one way or another, not even taking into account that they need to figure out they're supposed to call this) instead of implementing it here.
Additionally, I wonder how this isn't a problem for anyone else initializing the SDK later while the app is already running? I.e. not talking about hybrid SDKs but any app using the Cocoa SDK.
Proposal:
How about we change the logic and automatically do what SentryHybridSdkDidBecomeActive does, i.e. start session if session tracking is enabled. Track OOM, etc.
We can first check that the app is in the foreground.
I can't recall exactly why we came up with this solution. It seemed like a good choice when we implemented it in #913 to fix a related Dart issue getsentry/sentry-dart#274. While your proposal makes sense, why should we change it now? What problem do we solve? We already have it implemented like that in all SDKs; changing it is extra work.
Description
Problem description
There's a notification exposed for hybrid SDKs which they're supposed to call when an app becomes active (
SentryHybridSdkDidBecomeActive
). This is because if the app was already active at the time the normal DidBecomeActive notification is registered, it would never get triggered.The problem with this solution is that it shifts the issues to all individual consuming SDKs (which is bound to fail one way or another, not even taking into account that they need to figure out they're supposed to call this) instead of implementing it here.
Additionally, I wonder how this isn't a problem for anyone else initializing the SDK later while the app is already running? I.e. not talking about hybrid SDKs but any app using the Cocoa SDK.
Proposal:
How about we change the logic and automatically do what
SentryHybridSdkDidBecomeActive
does, i.e. start session if session tracking is enabled. Track OOM, etc.We can first check that the app is in the foreground.
Context
Found this out when figuring out getsentry/sentry-dart#2412 (comment) with a fix in getsentry/sentry-dart#2452
The text was updated successfully, but these errors were encountered: