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

Activity breadcrumbs should report their own "previous" state #1818

Merged
merged 1 commit into from Mar 15, 2023

Conversation

lemnik
Copy link
Contributor

@lemnik lemnik commented Mar 15, 2023

Goal

Fix 1817 by associating the "previous" state with its Activity.

Changeset

Replace the global "previous" state with a WeakHashMap<Activity, String>. When an Activity.onDestroy is called the Activity is preemptively removed from the map. Since the activity lifecycle callbacks are always invoked from the main thread, access to the WeakHashMap is left unsynchronized.

Testing

A new unit test was added testing interleaved Activity lifecycles.

@lemnik lemnik requested a review from kstenerud March 15, 2023 08:15
@lemnik lemnik force-pushed the PLAT-9820/fix-previous-activity-state branch from 3db765f to 4d6f15d Compare March 15, 2023 08:16
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Mar 15, 2023

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1921.31 1696.72
arm64_v8a 680.33 459.15
armeabi_v7a 614.8 393.62
x86 754.04 532.86
x86_64 725.38 504.19

Generated by 🚫 Danger

@lemnik lemnik force-pushed the PLAT-9820/fix-previous-activity-state branch from 4d6f15d to 392f501 Compare March 15, 2023 08:28
@lemnik lemnik force-pushed the PLAT-9820/fix-previous-activity-state branch from 392f501 to 35bcc63 Compare March 15, 2023 15:43
@lemnik lemnik merged commit 4748159 into next Mar 15, 2023
@lemnik lemnik deleted the PLAT-9820/fix-previous-activity-state branch March 15, 2023 16:31
@lemnik lemnik mentioned this pull request Mar 23, 2023
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.

ActivityBreadcrumbCollector surfaces the wrong activity previous state
3 participants