8000 Fix offline detection and logging by maxbbb · Pull Request #6523 · rainbow-me/rainbow · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix offline detection and logging #6523

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

Merged
merged 2 commits into from
Mar 26, 2025
Merged

Fix offline detection and logging #6523

merged 2 commits into from
Mar 26, 2025

Conversation

maxbbb
Copy link
Contributor
@maxbbb maxbbb commented Mar 24, 2025

Fixes APP-2495

What changed (plus any additional context for devs)

  • Refactored the useIsOnline hook into useIsOffline. Fixes the analytics logging logic that was incorrectly logging offline when the status was not offline and adds optional debouncing interval so that intermittent offline states can be ignored. Also does not log if offline state is detected while app is not in active state.
  • Since the useIsOffline hook logs an analytic, it should only be used in one place in the app. It was previously used in OfflineToast and TestnetToast. For just getting the offline status the network status hook from the netinfo library should be used directly.
  • Since previous network analytics were incorrect, updated to use analyticsv2 with new analytic names.
    • Offline / Lost connect -> network_status.offline
    • Reconnected after Offline -> network_status.reconnected
  • Updates to the latest version of @react-native-community/netinfo, which includes a fix for duplicate internet reachability requests.

Copy link
linear bot commented Mar 24, 2025

Copy link

Updated dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@react-native-community/netinfo@9.0.011.4.1 None 0 547 kB mattoakes

View full report↗︎

@maxbbb maxbbb requested review from walmat and derHowie March 25, 2025 16:01
Copy link
Member
@derHowie derHowie left a comment

Choose a reason for hiding this comment

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

👌

@maxbbb maxbbb merged commit 90b2828 into develop Mar 26, 2025
7 of 8 checks passed
@maxbbb maxbbb deleted the @kane/fix-offline branch March 26, 2025 21:29
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
0