feat(native): consent-aware offline caching#1649
Open
jpnurmi wants to merge 4 commits intojpnurmi/feat/cache-consentfrom
Open
feat(native): consent-aware offline caching#1649jpnurmi wants to merge 4 commits intojpnurmi/feat/cache-consentfrom
jpnurmi wants to merge 4 commits intojpnurmi/feat/cache-consentfrom
Conversation
|
4dcc514 to
a1bd38b
Compare
1153f08 to
288e92a
Compare
018814e to
699926f
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 699926f. Configure here.
a1bd38b to
9c2a6df
Compare
Pipe require_user_consent through the crash IPC shmem, load fresh persisted consent in the daemon at crash time, and route the crash envelope and run-folder envelopes through sentry__capture_envelope so the send/cache/discard policy is unified with the rest of the SDK. The external crash reporter branch is left untouched. sentry__capture_envelope takes the options explicitly so it can be called from the daemon, which has its own local options (no global). All in-process callers are updated. Also extends test_native_consent_revoke with a second-run consent-give step that flushes the cached envelope. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4 MB was set back when envelopes were breakpad/crashpad-only and small. Native-backend envelopes carry a full minidump in-envelope and can exceed 4 MB (especially under ASAN, which loads extra libraries that balloon the module list), causing cleanup_cache to prune even a single entry that's bigger than the limit. test_cache_max_size still exercises size pruning, just with 5x4 MB envelopes against the 16 MB limit (expects <=4 survive). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
If the crash envelope failed to load, the cleanup path still dispatched run-folder envelopes via sentry__capture_envelope with the run's default SENTRY_USER_CONSENT_UNKNOWN, causing them to be cached or discarded even when consent had been given.
cea6540 to
ee0676c
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

This PR implements consent-aware offline caching for the Native backend.
Pipe
require_user_consentthrough the crash IPC shmem, load fresh persisted consent in the daemon at crash time, and route the crash envelope and run-folder envelopes throughsentry__capture_envelopeso the send/cache/discard policy is unified with the rest of the SDK.sentry__capture_envelopetakes the options explicitly so it can be called from the daemon, which has its own local options (no global). All in-process callers are updated.Note:
cache_max_sizewas bumped from 4 to 16 MB in the example because the native-backend's crash envelopes carry the full minidump and can exceed 4 MB (especially under ASAN).sentry__cleanup_cachethen prunes the only entry on next startup, which was makingtest_native_cache_consentflaky.See also:
#skip-changelog (in #1542)