Skip to content
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

SDK doesn't start session on first app launch on iOS #271

Closed
philipphofmann opened this issue Jan 18, 2021 · 8 comments
Closed

SDK doesn't start session on first app launch on iOS #271

philipphofmann opened this issue Jan 18, 2021 · 8 comments

Comments

@philipphofmann
Copy link
Member

philipphofmann commented Jan 18, 2021

Platform:
iOS

The version of the SDK (See pubspec.lock): 4.0.1


I have the following issue:
The sentry-cocoa SDK doesn't start a session on the first launch of the app, because SentrySessionTracker.didBecomeActive doesn't fire. If you put the app in the background and open it again didBecomeActive fires. I'm not sure if we need to fix this in sentry-cocoa, in sentry-flutter, or both.

Steps to reproduce:

  • Start sample app
  • Put the app in the background for 31 seconds
  • Launch the app again

Actual result:
The SDK doesn't send a session.

Expected result:
The SDK should send a healthy session.

This is related to getsentry/sentry-react-native#1292

@marandaneto
Copy link
Contributor

@philipphofmann this is an issue on RN SDK or Flutter SDK?

@philipphofmann
Copy link
Member Author

It's an issue on both SDKs.

@marandaneto
Copy link
Contributor

@philipphofmann interesting, wondering if something has changed on the cocoa sdk, because this has been tested on flutter and RN by @bruno-garcia and @jennmueng as well.

@philipphofmann
Copy link
Member Author

Nothing really changed on the Cocoa side. I also don't fully understand why this is an issue now, as you tested this on both Flutter and RN. Maybe I'm mistaken, but I opened up these issues yesterday to document what I found.

@marandaneto
Copy link
Contributor

marandaneto commented Jan 19, 2021

I'll give it a try, thx

edit: tested it on Android, it worked well.
on iOS, I could reproduce it using iPhone 12 mini, release mode.

@marandaneto marandaneto added bug and removed question labels Jan 19, 2021
@marandaneto
Copy link
Contributor

the notification UIApplicationDidBecomeActiveNotification on iOS is triggered before the SDK had the chance to register into it.

@philipphofmann
Copy link
Member Author

the notification UIApplicationDidBecomeActiveNotification on iOS is triggered before the SDK had the chance to register into it.

That's also what I would have guessed.

So either we init Cocoa sooner or we somehow push the Flutter like event down to Cocoa.

@marandaneto
Copy link
Contributor

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

No branches or pull requests

2 participants