Copy NDK crash reports prior to flushOnLaunch() #1164
Merged
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.
Goal
Copies NDK crash reports to the bugsnag-errors directory prior to
flushOnLaunch()
being called. This ensures that any NDK reports which occurred during the launch period are flushed appropriately.Changeset
The NDK plugin now calls
setupNdkPlugin()
, which installs signals handlers, syncs the initial state to the NDK layer (metadata/context etc), then copies any existing NDK crash reports to the bugsnag-errors directory.NativeInterface#deliverReport()
no longer needs to calleventStore.flushAsync()
because it is now guaranteed that the crash report will be copied beforeflushOnLaunch()
is called.It's worth noting that this copy takes place on the main thread. PLAT-5736 and PLAT-5975 will make some pre-requisite changes to how synchronous sending of reports works, which will allow NDK crash reports to only be copied if they are startup crashes. Implementing this functionality in the current changeset would likely lead to unnecessary rework.
Testing
Relied on existing E2E test coverage and log messages to confirm the NDK crash report is copied over at the appropriate time.