WIP: feat(cache): consent-aware event caching#1542
Draft
jpnurmi wants to merge 3 commits intojpnurmi/feat/http-retryfrom
Draft
WIP: feat(cache): consent-aware event caching#1542jpnurmi wants to merge 3 commits intojpnurmi/feat/http-retryfrom
jpnurmi wants to merge 3 commits intojpnurmi/feat/http-retryfrom
Conversation
Instead of discarding envelopes when user consent is not given, write them to <database>/cache/ when cache_keep is enabled. For old runs, extend can_cache to also apply when consent is missing, so envelopes are moved to cache instead of being discarded. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
b73bccd to
680a83e
Compare
Consent-revoked envelopes were cached as `<uuid>.envelope` which `sentry__retry_send()` skips (filename ≤45 chars). Write them in retry format (`<ts>-<count>-<uuid>.envelope`) so they're picked up when consent is later given. - Add `retry_count` param to `write_envelope()`, `sentry__run_write_cache()`, and `sentry__run_move_cache()`: >= 0 produces retry format, -1 plain format - Add lock-free consent check to `sentry__retry_send()` using stored `user_consent` pointer (same pattern as the batcher) - Make `sentry__retry_write_envelope` static; remove from public header - Skip `sentry__capture_envelope()` in `process_old_runs` when consent missing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
680a83e to
24dc128
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Depends on:
require_user_consentandcache_keepare both enabled, cache envelopes to disk instead of discarding them when consent is not givenuser_consentbefore sending cached envelopessentry_transport_retry()to trigger sendingClose: #1521