0.1.3688 on Windows 11: after a restart by a script, "timed out after 1m0s
waiting for the WebView2 controller" and the window never came back. Wails
waits 60s in Embed for a controller, then exits the process (ErrorHandler
runs, then os.Exit). The cause is a start that meets the previous magpie's
msedgewebview2 still holding the profile folder (EBWebView\lockfile, opened
without sharing).
- Before the first window, the start waits (30s at most) until the profile
folder's lockfile can be opened, i.e. the old WebView2 has let go. The
folder is the one passed to Wails, else Wails' %AppData%\<exe name>.
- ErrorHandler now logs the error with the WebView2 runtime version, the
folder and whether another process holds it.
- On a WebView2 failure the process starts itself again (update.Respawn,
MAGPIE_REPLACES set so the new one waits for this one to exit), backing
off 2s, 4s; after 3 starts a box says what failed and what to do.
Run: gofmt; go vet darwin, GOOS=windows, GOOS=linux with and without
nogui; go test of the WebView2 tests on mote; the same on xiaomi-gpu via
win-run, where TestWebView2FreeSeesTheHeldLockfile holds a real
non-shared file and goes red when webView2Free is forced true (broken by
hand). Full gui/update/proc packages on mote.
Not tried: a real WebView2 timeout and the restart (the controller
timeout can't be forced here without the live app); Wails still exits
the process after the handler, so the tray does not stay up through a
failed start, it is started again instead.