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

Missing crashes when tracking consent is pending #1701

Open
kublaios opened this issue Feb 27, 2024 · 6 comments
Open

Missing crashes when tracking consent is pending #1701

kublaios opened this issue Feb 27, 2024 · 6 comments

Comments

@kublaios
Copy link

Question

The Datadog SDK is initialized during the app launch with trackingConsent set to pending and we update it during the user sign-in. The problem is that if the user experiences a crash before signing in, the emergency log/other logs are not uploaded to Datadog, even after the user signs in.

I expected that the logs would persist from the previous session until the tracking consent is granted and they are uploaded together with the logs in the current session. Is the current behavior the expected behavior and, if yes, is there a way of retrieving the crashes for sessions where tracking consent is pending/granted later?

@kublaios kublaios added the question Further information is requested label Feb 27, 2024
@maxep
Copy link
Member

maxep commented Feb 28, 2024

Hey @kublaios 👋

I expected that the logs would persist from the previous session until the tracking consent is granted and they are uploaded together with the logs in the current session.

That is how the SDK behaves: when the tracking consent is pending, data is collected and stored on disk (included crashes) but not upload. When consent is granted, the data previously collected is uploaded. If the user does not consent, then the data is erased from disk and no further data is collected.

In your case, if the user experience a crash before login then the crash will be stored on disk. When the user re-open the application and grant consent after login, then the previous crash will be uploaded.

Does it answer your question?

@maxep maxep added the awaiting response Waiting for response / confirmation from the reporter label Feb 28, 2024
@kublaios
Copy link
Author

Thanks for the swift response, @maxep.

Unfortunately, both on the live app as well as in our testing, we are losing crashes that occur before sign-in. Any log, for that matter. We noticed this when we discovered that some crashes are reported to Firebase Crashlytics but not Datadog. The same crash is reported to Datadog if it happens when the user is signed in.

I had also tried the following:

  • From a cold start, navigated through the app before signing in (consent: pending), then signed in. I was able to see logs pre-sign-in. I logged out and killed the app.
  • From the next cold start, navigated through the app unauthenticated, but killed the app before signing in this time. Then I reopened the app and signed in. I lost the logs from the session that I killed the app without signing in.

Could it be that only the logs from the same session are reported after consent is granted and the session identifier is reset upon the app is terminated/crashed?

@maxep maxep removed the awaiting response Waiting for response / confirmation from the reporter label Feb 28, 2024
@maxep
Copy link
Member

maxep commented Feb 28, 2024

Hey @kublaios,

Sorry, I was wrong on my previous comment: We only keep pending data for the current session, not from the previous one.
We are actually clearing pending data when the app starts, and we only report crashes when the consent is granted. Which mean that crashes happening before the login won't be reported..

You are getting crashes from Firebase Crashlytics before the consent is actually granted?

I will bring this topic to the team! thank you for the report 🙏

@maxep maxep added enhancement and removed question Further information is requested labels Feb 28, 2024
@kublaios
Copy link
Author

Sounds good, thanks @maxep.

You are getting crashes from Firebase Crashlytics before the consent is actually granted?

Yes, but since the Firebase analytics is disabled in our case, there is no additional consent we need to configure later on. As Datadog provides more context, we are evaluating whether to use it instead of Firebase Crashlytics and this capability would be a big plus.

@sathriyanIDPal
Copy link

@maxep

We have encountered a similar issue in our scenario where crashes are not being reported to Datadog when the consent is in a pending state during initialization.

We would greatly appreciate it if crashes could be reported once the consent status changes to Granted instead dropped completely.

Thank you.

@maxep
Copy link
Member

maxep commented Mar 12, 2024

Thanks for the additional details. It's a totally valid use case, it has been added to our backlog 👍
I keep this ticket open for tracking and visibility, stay tuned!

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

3 participants