Skip to content

feat(envelopes): Observe filtered envelope items#1182

Open
szokeasaurusrex wants to merge 3 commits into
szokeasaurusrex/envelope-type-improvementfrom
szokeasaurusrex/envelope-filter
Open

feat(envelopes): Observe filtered envelope items#1182
szokeasaurusrex wants to merge 3 commits into
szokeasaurusrex/envelope-type-improvementfrom
szokeasaurusrex/envelope-filter

Conversation

@szokeasaurusrex

@szokeasaurusrex szokeasaurusrex commented Jun 19, 2026

Copy link
Copy Markdown
Member

Add an EnvelopeFilter trait and callback container so callers can observe
items removed by Envelope::filter. This includes items rejected directly by
the filter and attachments removed later when their event or transaction is no
longer present.

Keep existing closure-based callers source-compatible through a blanket
FnMut(&EnvelopeItem) -> bool implementation. Some closure sites may need an
explicit item type annotation after this generalization.

Closes #1181
Closes RUST-245

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against e81af4d

@szokeasaurusrex szokeasaurusrex marked this pull request as ready for review June 19, 2026 16:23
@szokeasaurusrex szokeasaurusrex requested a review from lcian as a code owner June 19, 2026 16:23
@linear-code

linear-code Bot commented Jun 19, 2026

Copy link
Copy Markdown

RUST-245

Comment thread sentry-types/src/protocol/envelope.rs
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/envelope-filter branch from 408f667 to a3bcb31 Compare June 22, 2026 08:12
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/envelope-type-improvement branch from ea171be to 0bbc410 Compare June 22, 2026 08:12
szokeasaurusrex and others added 2 commits June 22, 2026 13:20
Add an `EnvelopeFilter` trait and callback container so callers can observe
items removed by `Envelope::filter`. This includes items rejected directly by
the filter and attachments removed later when their event or transaction is no
longer present.

Keep existing closure-based callers source-compatible through a blanket
`FnMut(&EnvelopeItem) -> bool` implementation. Some closure sites may need an
explicit item type annotation after this generalization.

Closes [#1181](#1181)
Closes [RUST-245](https://linear.app/getsentry/issue/RUST-245)

# Conflicts:
#	CHANGELOG.md
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/envelope-type-improvement branch from 0bbc410 to d8b9ef9 Compare June 22, 2026 11:20
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/envelope-filter branch from a3bcb31 to a504ed6 Compare June 22, 2026 11:20
@lcian

This comment has been minimized.

Comment thread sentry-types/src/protocol/envelope.rs Outdated
@szokeasaurusrex

Copy link
Copy Markdown
Member Author

@lcian regarding the CI failure, I have also noticed this flakiness, and have already opened an issue to investigate: #1112.

Co-authored-by: Lorenzo Cian <17258265+lcian@users.noreply.github.com>
@szokeasaurusrex szokeasaurusrex requested a review from lcian June 23, 2026 09:38
Comment thread sentry-types/src/protocol/envelope.rs

@lcian lcian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

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