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

[PLAT-6614] Stop session being reported if app is launched in the background #1108

Merged
merged 1 commit into from
Jun 3, 2021

Conversation

nickdowell
Copy link
Contributor

Goal

A session should not be reported if an app was started in the background (for example to perform a background fetch.)

Only once a user opens the app (and it moves to the foreground) should a session be recorded.

Changeset

BugsnagClient now checks whether the app is in the foreground before starting a session.

BugsnagSessionTracker now starts a session as soon as the app moves into the foreground if there was no previous session.

Testing

Manual testing only because it's not possible to trigger a background launch via Appium.

In one of the example Xcode projects, add the background fetch capability and then in the scheme's run options enable the Background Fetch option. Note: this only works when debugging an app.

E2E tests verify that automatic sessions reporting still works when an app is launched in the foreground.

@github-actions
Copy link

github-actions bot commented Jun 3, 2021

Infer: No issues found 🎉

OCLint: No issues found 🎉

Bugsnag.framework binary size did not change - 1,126,592 bytes

Generated by 🚫 Danger

@nickdowell nickdowell merged commit 5faa145 into next Jun 3, 2021
@nickdowell nickdowell deleted the nickdowell/no-session-for-background-launch branch June 3, 2021 09:30
@sethfri
Copy link

sethfri commented Jun 7, 2021

Does this mean if the app crashes during a background fetch, we'll no longer get crash reports? I'm not sure that's desirable. It's still useful to know about app crashes, since iOS can stop calling you for background fetches if the app is misbehaving

@nickdowell
Copy link
Contributor Author

@sethfri this does not stop crashes being reported, but it does mean they will no longer count against the app's stability score.

@sethfri
Copy link

sethfri commented Jun 7, 2021

@nickdowell Thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants