fix: Ensure context from previous run is used for native main crashes #683
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.
Closes #679 and #711
Native crashes in the main process are sent on the next app run. If the app updates before the next app run, the crash is reported with the wrong release.
This PR adds to the data persisted for use when reporting native main process cashes on next app start. We now also include context/release/environment in the persisted data so that we can correctly report the release and context.
Rather than attempt to cater for multiple different persisted object types, this PR changes the persisted file to
scope_v3.json
. This simplifies the code but means that any persisted scope will not be included if the app crashes immediately before the next app update that includes this code. However, all future native crashes will be reported with the correct release.