feat: add cache_dir header for external crash reporters#1698
feat: add cache_dir header for external crash reporters#1698
cache_dir header for external crash reporters#1698Conversation
|
External crash reporters only receive the envelope path, so include the cache directory in envelope headers when cache_keep is enabled. This lets capable reporters cache related files without changing the one-argument protocol. Fixes GH-1688 Co-Authored-By: OpenAI Codex <noreply@openai.com>
b6943ef to
2cab8cd
Compare
The native crash daemon loads crash envelopes from disk as raw envelopes. Materialize them before launching an external crash reporter when cache_keep is enabled, so the shared launcher can add the cache_dir header without mutating raw envelopes itself. Refs GH-1688 Co-Authored-By: OpenAI Codex <noreply@openai.com>
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 3454003. Configure here.
| SENTRY_WARN("Failed to materialize envelope for external crash report"); | ||
| sentry_envelope_free(envelope); | ||
| goto cleanup; | ||
| } |
There was a problem hiding this comment.
Materialization failure silently drops entire crash report
Medium Severity
When cache_keep and external_crash_reporter are both set and sentry__envelope_materialize fails, the envelope is freed and execution jumps to cleanup, completely dropping the crash report. Previously, the crash would always be sent (either externally or directly). The cache_dir header is a non-critical enhancement, so a materialization failure here needlessly loses crash data. By contrast, sentry__launch_external_crash_reporter in sentry_core.c handles this gracefully — it logs a warning but still sends the envelope without the header.
Reviewed by Cursor Bugbot for commit 3454003. Configure here.


External crash reporters only receive the envelope path, so include the cache directory in envelope headers when
cache_keepis enabled. This lets capable reporters cache related files without changing the single-argument CLI protocol.See also: