Skip to content

feat: consent-aware caching#147

Open
jpnurmi wants to merge 2 commits intogetsentryfrom
jpnurmi/feat/uploads-paused
Open

feat: consent-aware caching#147
jpnurmi wants to merge 2 commits intogetsentryfrom
jpnurmi/feat/uploads-paused

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented Apr 14, 2026

Adds two features for consumers that transiently revoke upload consent and want reports preserved for later upload:

  1. UploadsPaused setting — when set, ProcessPendingReports leaves pending reports untouched (no upload, no skip, no database scan). Independent of UploadsEnabled; reports retry on the next pass once the pause is cleared.

  2. CrashpadClient::RequestRetry() — wakes the handler's upload thread immediately instead of waiting for the periodic scan. Implemented as a client→handler IPC message on all three out-of-process platforms, piggybacking on each platform's existing channel. Handler side forwards to a new CrashReportUploadThread::RetryPending().

On macOS, the new message uses a shared ClientToServerMessage protocol in util/mach/exception_handler_protocol.{h,cc} (FourCC 'CPad' message ID, typed payload), mirroring the Linux and Windows layouts.

See also:

Comment thread handler/crash_report_upload_thread.cc
Comment thread handler/crash_report_upload_thread.cc
@jpnurmi jpnurmi changed the title feat: pause uploads for consent-aware caching feat: consent-aware caching Apr 14, 2026
@jpnurmi jpnurmi marked this pull request as draft April 14, 2026 17:59
Adds a new Settings flag that, when set, causes the upload thread to
leave pending reports in the pending state instead of uploading or
skipping them. Intended for consumers that transiently revoke upload
consent and want reports preserved for later upload once the pause is
cleared.

The flag is independent of UploadsEnabled and is checked at the top of
ProcessPendingReports. While paused, the known-pending queue is left
untouched and no database scan is performed, so reports are retried on
the next pass once the pause is cleared.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jpnurmi jpnurmi force-pushed the jpnurmi/feat/uploads-paused branch from f03626b to 50e6aac Compare April 14, 2026 19:20
@jpnurmi jpnurmi marked this pull request as ready for review April 15, 2026 06:26
Comment thread handler/mac/exception_handler_server.h Outdated
Comment thread client/crashpad_client_linux.cc
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 1 potential issue.

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 df19552. Configure here.

Comment thread client/crashpad_client_mac.cc Outdated
… thread

Allows clients to request an immediate retry of pending report uploads
rather than waiting for the handler's periodic scan. Useful after state
changes (for example, clearing UploadsPaused) that should take effect
without delay.

Adds a new client -> handler IPC message on all three out-of-process
platforms, piggybacking on each platform's existing channel:
  * Windows: new kRequestRetry type in ClientToServerMessage, sent via
    SendToCrashHandlerServer() on the existing named pipe.
  * Linux: new kTypeRequestRetry type in
    ExceptionHandlerProtocol::ClientToServerMessage, sent via
    UnixCredentialSocket over the existing handler socket.
  * macOS: new kRequestRetry type in ClientToServerMessage, sent via
    SendClientToServerMessage() to the existing exception Mach port
    and dispatched by a dedicated MachMessageServer::Interface
    registered alongside the exception and no-senders handlers. The
    struct, enum, and send/receive helpers live in a new
    util/mach/exception_handler_protocol.{h,cc} shared by client and
    handler, mirroring the Linux and Windows layouts.

On the handler side, each platform's Delegate gains a RequestRetry /
ExceptionHandlerServerRetryRequested / HandleClientToServerMessage
entry point that forwards to CrashReportUploadThread::RetryPending(),
a new method that wakes the worker thread without enqueuing a specific
UUID.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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