8000 fix(pwa): disable navigation preload and serve cached static app shell on handoff by InfinityPacer · Pull Request #79 · InfinityPacer/meterleaf · GitHub
[go: up one dir, main page]

Skip to content
< 8000 link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/global-nav-bar-b6c1daaca3b1cc28.js" fetchpriority="low" />

fix(pwa): disable navigation preload and serve cached static app shell on handoff - #79

Merged
InfinityPacer merged 2 commits into
mainfrom
fix/pwa-app-shell-and-preload
Nov 11, 2026
Merged

InfinityPacer merged 2 commits into
mainfrom
fix/pwa-app-shell-and-preload

Conversation

@InfinityPacer
Copy link
Copy Markdown
Owner

变更说明

  • 在 public/sw.js 升级激活阶段显式禁用浏览器导航预加载(navigationPreload.disable())并移除 preloadResponse,修复 iOS WebKit 在 Wi-Fi 切换蜂窝网络时底层预加载请求挂在失效连接上无法被 AbortController 中止、进而通过 HTTP/2 连接复用堵住后续同源探活请求的问题。
  • 在构建阶段将纯静态前端资源清单与内容指纹注入 sw.js,在线访问时缓存纯静态首页壳与带哈希的 /assets/* 脚本样式字体,切网握手超时或断网时直接秒开应用主界面壳,同时严格保持 /api/* 只走网络不写入缓存,登录重定向时自动驱逐本地首页壳缓存。
  • 在 App.tsx 与 report-building.ts 为首次断网读取增加联网事件触发与 3 秒自动恢复探测,网络恢复后一并刷新归档与同步状态查询,重新登录前清理本地前端壳缓存并预留完整认证超时窗口。
  • 准备发布 0.16.7 版本。

验证结果

  • bun run test 全量 85 个测试文件 628 项测试通过。
  • tests/pwa.browser.ts 真实 Chromium 离线回退静态界面壳、冷缓存离线兜底页与联网自动恢复验收通过。
  • 本地 TCP 模拟 Wi-Fi 切蜂窝网首条导航挂死连接场景实测约 541 毫秒直接打开主界面并加载实时账本,全程无白屏与离线拦路页。
  • bun run build、bunx prettier --check 与 git diff --check 通过。

@InfinityPacer
InfinityPacer merged commit 197124e into main Nov 11, 2026
2 checks passed
@InfinityPacer
InfinityPacer deleted the fix/pwa-app-shell-and-preload branch November 11, 2026 04:50
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

0