Skip to content

feat(core): [Scope-Based Deduplication 1] Add event processor fork semantics - #6429

Draft
adinauer wants to merge 1 commit into
feat/scope-based-deduplicationfrom
feat/scope-based-deduplication-processor-fork
Draft

adinauer wants to merge 1 commit into
feat/scope-based-deduplicationfrom
feat/scope-based-deduplication-processor-fork

Conversation

@adinauer

@adinauer adinauer commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

PR Stack (Scope-Based Deduplication)


📜 Description

Add a default EventProcessor.fork() lifecycle contract and invoke it whenever a Scope is cloned. Preserve processor ordering and reuse the original processor if customer extension code returns null or fails recoverably.

💡 Motivation and Context

Stateful event processors need independent state when isolation scopes are cloned, while existing stateless and customer-defined processors must remain shared by default. This establishes the lifecycle primitive needed for request-local duplicate event detection.

refs: #6365

💚 How did you test it?

  • ./gradlew :sentry:test
  • ./gradlew spotlessApply :sentry:updateKotlinAbi
  • Added coverage for default and custom forks, ordering, recoverable failures, fatal errors, and CombinedScopeView cloning.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The next PR adds the internal scope-based duplicate event processor using this fork contract.

#skip-changelog

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

Allow stateful event processors to create independent instances when scopes are cloned while preserving existing sharing behavior by default. Reuse the original processor on recoverable extension failures so scope cloning remains host-safe.

Refs GH-6365

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

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

Generated by 🚫 dangerJS against 1863883

@sentry

sentry Bot commented Oct 30, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.62.0 (1) release

⚙️ sentry-android Build Distribution Settings

This branch has not been deployed

No deployments
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.

1 participant