This repository has been archived by the owner on Sep 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
Add stopSession() and resumeSession() to public API #314
Merged
Conversation
This file contains 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
…ly tracking sessions in native
bullmo
reviewed
Mar 1, 2019
snmaynard
reviewed
Mar 1, 2019
Thanks for the review - I have update the inline code docs to clarify when an error counts towards the stability score. |
bengourley
reviewed
Mar 4, 2019
bengourley
suggested changes
Mar 5, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually tested and it works as expected 👍
The only thing I would change is adding the session methods to the TypeScript app test/app.ts
that is used to assert the types are correct. I already tried this out on my working copy and the tests pass but it would be helpful to catch any regressions:
client.notify(new Error('flop'))
client.setUser('123', 'B. Nag', '[email protected]')
client.setUser(undefined, undefined, undefined)
client.setUser()
+client.stopSession()
+client.startSession()
+client.resumeSession()
bengourley
approved these changes
Mar 5, 2019
Jekiwijaya
pushed a commit
to Jekiwijaya/bugsnag-react-native
that referenced
this pull request
Mar 11, 2019
Restore mach handler to full functionality. There was a missing import which led to an undefined `define` which was required, causing fallback to the signal handler in situations where more debugging information was available.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Adds the ability to stop and resume sessions. This prevents the handled/unhandled error count from incrementing when a session is in the stopped state, which may be desirable if a user manually tracks sessions and does not want crashes that occurred in the background to count towards their stability score.
Note: the first two commits of this changeset updates vendored code which has already passed review. It may be easier to review these changes in isolation by viewing this diff.
For reference, the PRs which add this functionality for Android/Cocoa can be found here:
bugsnag/bugsnag-android#429
bugsnag/bugsnag-cocoa#325
Changeset
stopSession()
andresumeSession()
to the JS API, which forward the call onto theNativeClient
stopSession()
andresumeSession()
implementations in the Android + Cocoa native package. These are invoked asychronously across the React Native bridge by the JS methods, and in turn invoke the appropriate method in bugsnag-android/bugsnag-cocoaresumeSession
rather thanstartSession
(rationale described further in design doc)Tests
I performed the following manual tests on the 'plain' example project on Android/iOS release builds (see contributing guide for instructions), by inspecting the payload sent to netcat:
Note: Mazerunner scenarios will be added in a separate PR, once implementation of this functionality on bugsnag-unity is complete.