Skip to content

Inconsistent event drop vs session update logic #1916

@bruno-garcia

Description

@bruno-garcia

We've received from a customer:

captureEvent() :

  • if the event is dropped because its throwable is in the ignoredExceptionForTypes , method will immediately return the SentryId.EMPTY_ID , and nothing will be sent (see here)
  • if the event is dropped because beforeSend callback returned null (see here), method still will build the envelope without the event, but with the updated session and will send it, because session is updated (error amount is incremented) before the beforeSend filtering is happening (see here)
  • and if the event is dropped because EventProcessor returned null (see here), session will be null, so it won't be updated, and also it won't be sent (see here)

This means that all 3 ways of dropping events are inconsistent with each other, and it's not documented anywhere:

  • using ignoredExceptionForTypes will effectively drop the event, won't update the session, and won't send anything (not the dropped event, not the session, not the attachments)
  • using beforeSend callback will drop the event, but still update the session, so it'll still send the updated session (with incremented error count) and attachments (if any)
  • using EventProcessor will drop the event, won't update the session, but still will send the attachments, if there are any

We need to align and document the side effect of dropping an event with regards to session updates.

Note, this relates slightly to the Client Reports #1894

Metadata

Metadata

Assignees

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions