jim800121chen
35db6c8167
fix(local-tool): Windows popup 卡死 safety net + appLog 覆蓋啟動流程
使用者回報 c649a81 之後仍看到「正在停止伺服器…」popup 一打開就卡住。
無法在不看 log 的情況下推斷根因,先加三層 safety net 確保 popup 不是
blocker,並把關鍵啟動訊息寫到 wails.log 供 Windows 除錯。
Safety net 三層:
1. 前端 watchdog:shutdown-modal 最多顯示 15 秒,超時自動 hide 並 toast
提示使用者 server 可能還沒停掉。
2. 前端 escape hatch:點 backdrop 空白處 / 按 Esc 可手動關閉 popup。
3. Go 端 hardBailout timer:stopGraceful 最多跑 shutdownGraceV2 + 2 秒
(目前 = 9 秒),到上限直接 return leak process,避免 Process.Wait
永遠阻塞(Windows 偶有情境)。graceTimer 分支的 `<-done` 也改成
非阻塞 `select-with-1s-timeout`。
Windows 除錯 log 強化:
4. startup 頭加版本識別標記到 wails.log:
==================================================
visionA-local startup build=dev buildTime=unknown
platform=windows arch=amd64 dataDir=...
fix marker: c649a81+ (Stage3 waitHealthy pause / shutdown modal safety net)
==================================================
使用者拉新版後啟動可從此確認 build 是否是最新版。
5. app.go 把 startup 路徑上的 fmt.Fprintln(os.Stderr, ...) 改 appLog:
IPC server start / seed failure / Stage 1 complete / ctrl.Start 結果。
Windows 上 stderr 是 null device,appLog 會同時寫檔到 wails.log。
6. server_control.go stopGraceful 加 appLog 記錄 entry / modal-show /
grace timer / hard bailout / return,整條 Stop 路徑完全透明。
7. driver auto-install failed 訊息也改 appLog。
驗證:
- visiona-local 套件 go build / vet / test -race 全綠
- macOS dmg 163MB 重 build OK
需要使用者協助:拉新版後在 Windows 乾淨環境試,啟動後貼以下三個檔案
內容給我:
%APPDATA%\visiona-local\logs\wails.log — appLog 記錄整個啟動流程
%APPDATA%\visiona-local\logs\server.stdout.log — server subprocess stdout
%APPDATA%\visiona-local\logs\server.stderr.log — server subprocess stderr
log 裡有「fix marker: c649a81+」即為本 commit 或更新;若沒有 marker
或 marker 指向別的 commit 則代表 build 不是最新版。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 22:31:15 +08:00
..
2026-04-12 04:59:23 +08:00
2026-04-15 22:31:15 +08:00
2026-04-11 22:10:38 +08:00
2026-04-15 22:31:15 +08:00
2026-04-11 22:10:38 +08:00
2026-04-11 22:10:38 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 17:57:54 +08:00
2026-04-12 05:25:32 +08:00
2026-04-12 05:25:32 +08:00
2026-04-12 05:25:32 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 22:31:15 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 17:57:54 +08:00
2026-04-15 21:30:59 +08:00
2026-04-15 21:30:59 +08:00
2026-04-12 04:42:41 +08:00