Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bugsnag.isStarted #1621

Closed

Conversation

slack-jallen
Copy link
Contributor

Goal

Add Bugsnag.isStarted so that it is possible to check whether it is safe to call the other methods. Currently to use Bugsnag safely you either have to keep track of this yourself or wrap calls in try/catch.

Design

Add a static method

Changeset

Bugsnag.java

Testing

Added unit tests

@slack-jallen slack-jallen marked this pull request as ready for review March 11, 2022 19:54
@luke-belton
Copy link
Member

hey @slack-jallen - thanks for the PR!

Would you be able to share a little more info on your use case here please?

Why do you need the isStarted method? We’d usually recommend starting Bugsnag immediately at app launch, so is there a reason why Bugsnag.start might be delayed in your app?

Are you trying to store things (e.g. breadcrumbs, metadata) potentially before Bugsnag has started?

@luke-belton luke-belton added the needs discussion Requires internal analysis/discussion label Mar 16, 2022
@slack-jallen
Copy link
Contributor Author

hey @slack-jallen - thanks for the PR!

Would you be able to share a little more info on your use case here please?

Why do you need the isStarted method? We’d usually recommend starting Bugsnag immediately at app launch, so is there a reason why Bugsnag.start might be delayed in your app?

Are you trying to store things (e.g. breadcrumbs, metadata) potentially before Bugsnag has started?

It's not so much that it is delayed, it is that it might not be started at all depending on the configuration. It would be nice to know if Bugsnag API's are going to throw "IllegalStateException" before calling them.

@luke-belton
Copy link
Member

Hi @slack-jallen - thanks for the info. We'd usually recommend starting Bugsnag in all cases and using the enabledReleaseStages config option to disable reporting in certain environments. Is there a reason why this isn't appropriate here?

Feel free to write in to [email protected] if you'd prefer to answer this away from a public forum!

@luke-belton luke-belton added the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label Mar 16, 2022
@slack-jallen
Copy link
Contributor Author

Hi @slack-jallen - thanks for the info. We'd usually recommend starting Bugsnag in all cases and using the enabledReleaseStages config option to disable reporting in certain environments. Is there a reason why this isn't appropriate here?

Thanks for the info. The app is using enabledReleaseStages, but on top of that the app also has a separate config that determines whether to call start at all. I guess you want to guide people to always call Bugsnag.start()? I guess if that's your guideline we'll have to inject this config decision ourselves.

@ZacSweers
Copy link

There are three cases that come to mind:

  • early stage app initialization where crash reporting isn't necessarily enabled
  • sample/playground apps that use common nonfatal reporting of some sort but aren't registered bugsnag apps themselves
  • instrumentation/e2e tests that run the full app but without crash reporting

I don't think that enabling bugsnag everywhere is a reasonable solution, especially the latter two in a data-privacy sensitive environment

@luke-belton luke-belton removed awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. needs discussion Requires internal analysis/discussion labels Mar 16, 2022
@luke-belton
Copy link
Member

Thanks for the additional info @slack-jallen, @ZacSweers!

We're happy to add this feature, so we'll take the PR from here and get it merged 👍

@luke-belton luke-belton added feature request Request for a new feature scheduled Work is starting on this feature/bug labels Mar 16, 2022
@tomlongridge
Copy link
Contributor

Thanks @slack-jallen – I've included your changes on #1640 and we'll include in the next release.

@lemnik lemnik mentioned this pull request Mar 31, 2022
@xljones xljones added released This feature/bug fix has been released and removed scheduled Work is starting on this feature/bug labels Apr 1, 2022
@xljones
Copy link

xljones commented Apr 1, 2022

Thanks again for the contribution @slack-jallen, this has been released in https://github.com/bugsnag/bugsnag-android/releases/tag/v5.22.0

@slack-jallen
Copy link
Contributor Author

Thanks again for the contribution @slack-jallen, this has been released in https://github.com/bugsnag/bugsnag-android/releases/tag/v5.22.0

Awesome, thanks for taking it forward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature released This feature/bug fix has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants