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

[Android] Inconsistent event enrichment mechanism #3855

Open
TimBurik opened this issue Dec 18, 2024 · 2 comments
Open

[Android] Inconsistent event enrichment mechanism #3855

TimBurik opened this issue Dec 18, 2024 · 2 comments
Labels
Bug Something isn't working

Comments

@TimBurik
Copy link

Package

Sentry

.NET Flavor

.NET

.NET Version

9.0.100

OS

Android

SDK Version

4.12.2

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Initialize Sentry, enable BeforeSend feature, enable envelope caching
  2. Add enrichment logic to the BeforeSend callback
  3. Generate different types of events

We are trying to use BeforeSend feature as a unified mechanism of enrichment of Sentry events with additional context at the moment when these events occur. As an example, we are trying to add additional property UserId and also add an attachment as if it is a part of a large log file.
SentryPlayground.Issues.EventEnrichment.Android.zip

Expected Result

The behavior is consistent: all events are going through the process of enrichment has valid context in reports

Actual Result

The behavior is different for different cases:

  • for managed and java exceptions, BeforeSend is executed right away when exceptions occur, before writing to the envelope (so that even if there's no internet at the moment and envelope would be sent later - it already contains actual context at the moment of crash) - this is expected;
  • for native crashes, BeforeSend is executed only in the beginning of the next session, at which point context is already changed - this may lead to the cases when native crashes has incomplete/incorrect context attached to them;

Also, native crashes seems to have file attachment missing, but that might be related to the #3545

@TimBurik
Copy link
Author

Tagging @bruno-garcia

@jamescrosswell
Copy link
Collaborator

Thanks for the report and the repro @TimBurik.

We'll take a look once the 5.0.0 release is out (we're a bit short handed on the .NET SDK at the moment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants