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

ActivityBreadcrumbCollector surfaces the wrong activity previous state #1817

Closed
pyricau opened this issue Mar 14, 2023 · 2 comments · Fixed by #1818
Closed

ActivityBreadcrumbCollector surfaces the wrong activity previous state #1817

pyricau opened this issue Mar 14, 2023 · 2 comments · Fixed by #1818
Assignees
Labels
bug Confirmed bug released This feature/bug fix has been released

Comments

@pyricau
Copy link
Contributor

pyricau commented Mar 14, 2023

Activity lifecycle state breadcrumbs have a previous attribute that surfaces the previous state.

image

Unfortunately, as can be seen here, that previous state is not computed correctly and can be misleading. E.g. here we see an activity is receiving onStop() and yet the breadcrumb claims the previous state is onDestroy() which is impossible (onDestroy() is a final state).

This is happening because ActivityBreadcrumbCollector keeps a single field prevState which just stores whatever the last state update was for any activity, not necessarily for the activity that just got a new state.

/~https://github.com/bugsnag/bugsnag-android/blob/556daed227c2aecf9869a694e0803fb63afc50da/bugsnag-android-core/src/main/java/com/bugsnag/android/ActivityBreadcrumbCollector.kt#LL11C9-L11C18

Apps often have multiple activities having lifecycle events interleaved.

@lemnik
Copy link
Contributor

lemnik commented Mar 15, 2023

Hi @pyricau

Thanks so much for pointing this out! We'll have a fix for it out in the next release.

@lemnik lemnik self-assigned this Mar 15, 2023
@lemnik lemnik added bug Confirmed bug wip There is work in progress labels Mar 15, 2023
@lemnik lemnik added scheduled Work is starting on this feature/bug and removed wip There is work in progress labels Mar 15, 2023
@johnkiely1
Copy link
Member

The fix for this was released in v5.29.0

@johnkiely1 johnkiely1 added released This feature/bug fix has been released and removed scheduled Work is starting on this feature/bug labels Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug released This feature/bug fix has been released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants