Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d30860a. Configure here.
d30860a to
d64b832
Compare
d64b832 to
85c5eed
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## jpnurmi/feat/hints #2112 +/- ##
======================================================
+ Coverage 75.20% 75.35% +0.14%
======================================================
Files 103 104 +1
Lines 27936 28069 +133
Branches 5102 5126 +24
======================================================
+ Hits 21008 21150 +142
+ Misses 5600 5587 -13
- Partials 1328 1332 +4 🚀 New features to boost your workflow:
|
fb6c4ac to
579efa4
Compare
579efa4 to
902cae1
Compare
d8f1a2a to
6f6faf1
Compare
| sentry_backend_t *backend, const sentry_options_t *options) | ||
| { | ||
| native_backend_state_t *state = (native_backend_state_t *)backend->data; | ||
| if (!state || !state->event_path) { | ||
| if (!state || !state->event_path || sentry__atomic_fetch(&state->crashed)) { |
There was a problem hiding this comment.
Bug: The early-return guard sentry__atomic_fetch(&state->crashed) in native_backend_flush_scope prevents scope-level attachments added from an on_crash_func callback from being written, as the crashed state is set before the callback runs.
Severity: HIGH
Suggested Fix
Revert the order of operations in native_backend_flush_scope. The attachment manifest should be written before checking the state->crashed flag. This ensures that attachments added from within an on_crash_func are correctly persisted, restoring the behavior that was explicitly supported in the previous version.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/backends/sentry_backend_native.c#L1240-L1243
Potential issue: In `native_backend_flush_scope`, the new early-return guard checks
`sentry__atomic_fetch(&state->crashed)` before writing the attachment manifest. The
`crashed` state is set before the `on_crash_func` is invoked. Consequently, if
`sentry_add_attachment()` is called from within an `on_crash_func` callback, it triggers
`native_backend_flush_scope`, which now returns early. This causes the scope-level
attachment to be silently dropped. The previous implementation intentionally wrote the
manifest before this check to support this exact use case, so this change is a
regression.
Did we get this right? 👍 / 👎 to inform future reviews.

Merge attachments and pass as
hinttoon_crash, then use the resulting hint attachments in the envelope.Caution
BREAKING CHANGE:
on_crashcallbacks now have an additionalsentry_hint_t *hintparameter.Close: #2098