Skip to content

feat: add cache_dir header for external crash reporters#1698

Open
jpnurmi wants to merge 2 commits intomasterfrom
jpnurmi/fix/cache-external
Open

feat: add cache_dir header for external crash reporters#1698
jpnurmi wants to merge 2 commits intomasterfrom
jpnurmi/fix/cache-external

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented May 5, 2026

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 single-argument CLI protocol.

See also:

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

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

Generated by 🚫 dangerJS against 2cab8cd

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

Comment thread src/sentry_core.c
} else {
SENTRY_WARN("failed to add cache_dir to external crash report");
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Corrupted envelope sent after failed materialization

Medium Severity

When sentry__envelope_materialize fails, the envelope is left in a corrupted state — is_raw has been set to false, the raw payload has been freed, and the structured fields are only partially populated. Despite this, the code only logs a warning about the missing cache_dir header and proceeds to send the corrupted envelope via sentry__transport_send_envelope on the next line. This results in a corrupt or empty crash report being written to disk and handed to the external crash reporter, effectively losing the crash data. The failure path needs to avoid sending the corrupted envelope (or avoid the destructive materialization altogether).

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b6943ef. Configure here.

jpnurmi and others added 2 commits May 5, 2026 10:07
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>
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