Repository navigation
fix: stop weak-network dialog from popping on every fluctuation - #246
Conversation
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.
🤖 Codex-Style Code Review by OpenCode (Vue Best Practice Enabled)
Review (
|
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
registerNetworkListenershowed the warning unconditionally inside theconnectionchangehandler wheneversaveDatawas set oreffectiveTypewas2g/3g. The Network Information API fireschangeon 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
change- this keeps the useful behavior without any popup.offlineShownflag reset ononline, so it shows once per actual offline event instead of on every repeatedofflinefiring.networkStatus.poor.*i18n keys are kept (still aligned across locales percheck-i18n.mjs) in case the warning is reintroduced later.Verification
npx vue-tsc --build --force: passnpx eslint src/services/utils.ts: 0 errors (one pre-existing max-depth warning on main, untouched)node scripts/check-i18n.mjs: passnpx vite build: pass(fork PR #245 was closed because the code-review workflow cannot comment on cross-repo fork PRs; this same-repo PR reruns all checks properly.)