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

Avoid unnecessary network connectivity change breadcrumb #1540

Merged

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Dec 1, 2021

Goal

Android's ConnectivityManager always invokes a callback with the current network state when registerDefaultNetworkCallback is called. This led to a network connectivity change breadcrumb being logged on Bugsnag initialization for API >= 24, which wasn't strictly a network change as such.

This alters the changeset to ignore the initial change on API 24 and to only log a breadcrumb for subsequent network changes.

Testing

Added unit test coverage and manually confirmed that a breadcrumb is no longer left on Bugsnag initialization as a matter of course, but that genuine network changes afterwards are recorded.

@fractalwrench fractalwrench force-pushed the PLAT-7614/avoid-duplicate-connectivity-breadcrumb branch from 529f320 to afc7fb1 Compare December 1, 2021 14:05
@bugsnagbot
Copy link
Collaborator

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1353.17 1168.01
arm64_v8a 483.72 299.4
armeabi -492.59 -21.55
armeabi_v7a 455.06 270.74
x86 520.57 340.35
x86_64 508.29 323.97

Generated by 🚫 Danger

@fractalwrench fractalwrench force-pushed the PLAT-7614/avoid-duplicate-connectivity-breadcrumb branch from afc7fb1 to 749842e Compare December 1, 2021 14:54
@fractalwrench fractalwrench marked this pull request as ready for review December 1, 2021 16:07
Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fractalwrench fractalwrench merged commit 04d4b19 into next Dec 2, 2021
@fractalwrench fractalwrench deleted the PLAT-7614/avoid-duplicate-connectivity-breadcrumb branch December 2, 2021 09:13
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