[0.17] fix!: align last-crash detection with other SDKs - #2023
Open
jpnurmi wants to merge 6 commits into
Open
Conversation
Cache the crash state and consume `<db>/last_crash` during `sentry_init()` on non-Android platforms. This prevents the same crash from being reported on every later run when an embedding SDK does not call `sentry_clear_crashed_last_run()`. Keep the marker on Android, because sentry-java reads its timestamp to mark and end the previous native session, then deletes the marker. Removing it during native initialization would lose both the crash evidence and its timestamp: https://github.com/getsentry/sentry-java/blob/1321b401f62077a3f93f6b72d7728a1400d58e04/sentry/src/main/java/io/sentry/PreviousSessionFinalizer.java#L82-L121 Known getsentry downstream callers already clear the marker after initialization or after reading the cached state: - https://github.com/getsentry/sentry-dotnet/blob/44252011b7ec233c165e874a4998a94e83ab5341/src/Sentry/Platforms/Native/CFunctions.cs#L157-L161 - https://github.com/getsentry/sentry-unity/blob/3a8c5122ff02eb68be4c0de268ee04507bf2ddbd/src/Sentry.Unity.Native/SentryNativeBridge.cs#L142-L146 - https://github.com/getsentry/sentry-unreal/blob/5d255bce9185a7437ff5497281d2822b76dbe30b/plugin-dev/Source/Sentry/Private/GenericPlatform/GenericPlatformSentrySubsystem.cpp#L697-L703 Close: #1325
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2023 +/- ##
==========================================
+ Coverage 74.35% 74.40% +0.05%
==========================================
Files 104 104
Lines 26518 26521 +3
Branches 4824 4828 +4
==========================================
+ Hits 19717 19734 +17
+ Misses 5454 5443 -11
+ Partials 1347 1344 -3 🚀 New features to boost your workflow:
|
jpnurmi
force-pushed
the
jpnurmi/fix/clear-crashed-last-run
branch
from
August 25, 2026 14:54
e8dd12b to
73b7239
Compare
mujacica
approved these changes
Aug 26, 2026
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.
Cache the crash state and consume
<db>/last_crashduringsentry_init()by default. This aligns sentry-native with other Sentry SDKs and prevents the same crash from being reported on every later run.sentry_clear_crashed_last_run()is now deprecated.The Android NDK integration retains the marker because sentry-java reads its timestamp to mark and end the previous native session, then deletes it:
Known getsentry downstream callers can remove their now-redundant clear calls:
Close: #1325