Skip to content

fix: stop weak-network dialog from popping on every fluctuation - #245

Closed
wsxiaolin wants to merge 1 commit into
NetLogo-Mobile:mainfrom
wsxiaolin:fix/suppress-weak-network-dialog
Closed

wsxiaolin wants to merge 1 commit into
NetLogo-Mobile:mainfrom
wsxiaolin:fix/suppress-weak-network-dialog

Conversation

@wsxiaolin

Copy link
Copy Markdown
Member

Problem

The weak-network warning dialog popped up constantly: every network fluctuation (rtt/effectiveType re-estimation), every VPN connect/reconnect/switch, and even toggling Data Saver triggered it. Users on VPN or unstable mobile networks could see it dozens of times per session.

Root cause

registerNetworkListener showed the warning unconditionally inside the connection change handler whenever saveData was set or effectiveType was 2g/3g. The Network Information API fires change on every re-estimation of those values, so on weak links or VPN the handler runs repeatedly and each run popped a new dialog (naive-ui discrete dialog has no dedup).

Fix

  • Remove the weak-network dialog entirely. The silent side effects (cover/avatar image quality suffixes) are still refreshed on change - this keeps the useful behavior without any popup.
  • Keep the offline dialog, now edge-triggered via an offlineShown flag reset on online, so it shows once per actual offline event instead of on every repeated offline firing.
  • networkStatus.poor.* i18n keys are kept (still aligned across locales per check-i18n.mjs) in case the warning is reintroduced later.

Verification

  • npx vue-tsc --build --force: pass
  • npx eslint src/services/utils.ts: 0 errors (one pre-existing max-depth warning on main, untouched)
  • node scripts/check-i18n.mjs: pass
  • npx vite build: pass

The connection 'change' event fires on every rtt/effectiveType/saveData
re-estimation, so weak links and VPN reconnects popped the warning
dialog constantly. Remove the weak-network dialog entirely (image
quality degradation still updates silently) and keep only the offline
dialog, now edge-triggered so it shows once per actual offline event.
@wsxiaolin

Copy link
Copy Markdown
Member Author

Closing in favor of a same-repo PR #246: the code-review workflow cannot post comments on cross-repository fork PRs (GITHUB_TOKEN lacks comment permission), so its check fails on infra rather than on the change itself.

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.

1 participant