Skip to content

docs(native): update note on decref for event hooks - #18996

Open
JoshuaMoelans wants to merge 1 commit into
masterfrom
joshua/fix/native_clarification
Open

docs(native): update note on decref for event hooks#18996
JoshuaMoelans wants to merge 1 commit into
masterfrom
joshua/fix/native_clarification

Conversation

@JoshuaMoelans

Copy link
Copy Markdown
Member

DESCRIBE YOUR PR

Noticed in #18982 that we don't specify decref as a necessity for native event hooks discarding events. Adding it to our options docs with this PR.

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sentry-docs Ready Ready Preview Aug 10, 2026 11:57am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
develop-docs Ignored Ignored Aug 10, 2026 11:57am

Request Review

<SdkOption name="on_crash" type="function">

This function is called with a backend-specific event object, and can return a modified event object or nothing to skip reporting the event. In contrast to `before_send`, it is only called when a crash occurred. You can find detailed information concerning its usage in [Filtering](/platforms/native/configuration/filtering/#using-on_crash).
This function is called with a backend-specific event object, and can return a modified event object or nothing to skip reporting the event. To drop it, you **must** call `sentry_value_decref(event)` before returning. In contrast to `before_send`, it is only called when a crash occurred. You can find detailed information concerning its usage in [Filtering](/platforms/native/configuration/filtering/#using-on_crash).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unclear from the context what you need to return to drop the event. Can we align it with before-send and mention that in order to drop the event you need to return sentry_value_new_null()?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants