Skip to content

feat(cache): consent-aware offline caching#1542

Open
jpnurmi wants to merge 1 commit intojpnurmi/ref/run-consentfrom
jpnurmi/feat/cache-consent
Open

feat(cache): consent-aware offline caching#1542
jpnurmi wants to merge 1 commit intojpnurmi/ref/run-consentfrom
jpnurmi/feat/cache-consent

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented Feb 25, 2026

This PR implements consent-aware offline caching for inproc and breakpad. native and crashpad follow in separate PRs.

When a) user consent is revoked, and b) cache_keep is enabled, cache envelopes to <db>/cache/ instead of discarding them. Provided that http_retry is true, the retry module picks them up when consent is later given, or they can be sent manually via sentry_transport_retry().

See also:

@jpnurmi jpnurmi force-pushed the jpnurmi/feat/cache-consent branch 2 times, most recently from 680a83e to 24dc128 Compare February 26, 2026 09:42
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/http-retry branch from b133fd6 to 93db900 Compare March 17, 2026 16:15
Base automatically changed from jpnurmi/feat/http-retry to master March 31, 2026 19:23
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/cache-consent branch 3 times, most recently from 7cd8780 to df20646 Compare April 8, 2026 19:04
@jpnurmi jpnurmi changed the title WIP: feat(cache): consent-aware event caching feat(cache): consent-aware offline caching Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

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

Generated by 🚫 dangerJS against a1bd38b

@jpnurmi jpnurmi force-pushed the jpnurmi/feat/cache-consent branch from 7398628 to 7118dbc Compare April 10, 2026 09:45
@jpnurmi jpnurmi marked this pull request as ready for review April 10, 2026 11:01
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4500595. Configure here.

@jpnurmi jpnurmi changed the base branch from master to jpnurmi/ref/run-consent April 15, 2026 11:35
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/cache-consent branch from ade6ca2 to 4dcc514 Compare April 15, 2026 11:37
When user consent is required and currently revoked, route envelopes
through the cache instead of discarding them, so they can be sent once
consent is given. Caching is gated on cache_keep || http_retry — with
neither, envelopes are still discarded (existing behavior).

When http_retry is enabled, the retry poller stays alive while consent
is revoked, and giving consent triggers an immediate retry pass so
cached envelopes flush without waiting for the next poll.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/cache-consent branch from 4dcc514 to a1bd38b Compare April 15, 2026 12:58
@jpnurmi
Copy link
Copy Markdown
Collaborator Author

jpnurmi commented Apr 15, 2026

I split this into smaller, nicer to review PRs:

  1. pre-requisite/refactoring for accessing user consent from workers and daemons
  2. inproc & breakpad support (the foundations, this PR)
  3. native support (needs extra daemon-related changes)
  4. crashpad support (needs changes to crashpad)

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.

Add support for consent-aware event caching

2 participants