From 8fb6f2402c91ce75ac40a8fa65225d69354ce686 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 29 Jun 2026 22:53:44 -0400 Subject: [PATCH] fix: resolve multi-monitor drag crash by bumping wails3 to alpha2.109 The app crashed entirely (os.Exit(1)) when the window was dragged between monitors. Root cause is upstream wails #5650: while the window is moving to another monitor the WebView2 controller is transitional, and Chromium.Focus() called controller.MoveFocus() unconditionally -> ERROR_INVALID_STATE, which older builds treated as fatal. It bypasses Go recover(), so parley.log never captured it. - Bump wails/v3 alpha2.105 -> alpha2.109 (webview2 v1.0.24 -> v1.0.27). The crash fix is webview2 v1.0.25 (wails alpha2.106, #5568); alpha2.109 also carries the mixed-DPI redraw follow-on fix (#5677/#5689) needed here. - Bump @wailsio/runtime to alpha.95 to match (spec kept as "latest"). - Correct the stale README known-issue (wrong root cause / version) and the main.go comment that implied logPanic could catch this os.Exit crash. Co-Authored-By: Claude Opus 4.8 --- README.md | 32 +++++++++++++++++++++----------- frontend/package-lock.json | 33 ++++++++++++++++++++++++--------- go.mod | 5 ++--- go.sum | 10 ++++------ main.go | 7 +++++-- 5 files changed, 56 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 380a05a..24bc14c 100644 --- a/README.md +++ b/README.md @@ -343,18 +343,28 @@ Audio is recorded per source under your app-data `recordings/session-/` fold - **LLM "context deadline exceeded".** The endpoint didn't answer in time — check the URL/port, that the server is up, and (for local servers) that the model finished loading. The Settings dialog now explains common failures. -- **App crashes when dragging the window between monitors.** This was a WebView2 bug - that fired when a window crosses a DPI boundary (e.g. a 100 % screen → a 150 % - screen): WebView2 momentarily reports `RESOURCE_NOT_IN_CORRECT_STATE`, and older - Wails builds treated that transient COM error as fatal (`os.Exit`). It is fixed in - the Wails version this repo targets (`v3.0.0-alpha2.105`, which carries the fixes for - upstream issues - [#5544](https://github.com/wailsapp/wails/issues/5544)/[#5580](https://github.com/wailsapp/wails/issues/5580) - and [#5605](https://github.com/wailsapp/wails/issues/5605)). If you still see the - crash: +- **App crashes when dragging the window between monitors.** This was a WebView2 bug: + while the window is moving to another monitor the WebView2 controller is briefly in a + transitional state, and `Chromium.Focus()` called `controller.MoveFocus()` + unconditionally — which returns `ERROR_INVALID_STATE` (`0x8007139F`). Older Wails + builds treated that transient COM error as fatal (`os.Exit(1)`), taking the whole + process down. (It reproduces on same-DPI setups too, not only across a DPI boundary.) + Note that Parley's panic logging could never catch this — `os.Exit(1)` bypasses + deferred funcs and `recover()`, which is why the crash left no trace in `parley.log`. + + The crash fix is upstream issue + [#5650](https://github.com/wailsapp/wails/issues/5650) / + [#5568](https://github.com/wailsapp/wails/pull/5568), shipped in `webview2 v1.0.25` + (first bundled in Wails `v3.0.0-alpha2.106`). A follow-on mixed-DPI bug where content + shrinks then disappears after a cross-DPI drag + ([#5677](https://github.com/wailsapp/wails/issues/5677) / + [#5689](https://github.com/wailsapp/wails/pull/5689)) was fixed in + `v3.0.0-alpha2.109`. This repo now targets **`v3.0.0-alpha2.109`** (pins + `webview2 v1.0.27`), which carries both fixes. If you still see the crash: 1. **Rebuild clean** so the fixed library is actually linked: - `go clean -cache && rm -rf bin && wails3 build`. Confirm the resolved version with - `go list -m github.com/wailsapp/wails/v3` (expect `…alpha2.105`). + `go clean -cache && rm -rf bin && wails3 build`. Confirm the resolved versions with + `go list -m github.com/wailsapp/wails/v3` (expect `…alpha2.109`) and + `go list -m github.com/wailsapp/wails/webview2` (expect `v1.0.27`, must be ≥ v1.0.25). 2. **Update the WebView2 Runtime** on the machine (old Evergreen runtimes mishandle the DPI transition). 3. If it persists, it's likely a different un-converted WebView2 call site — grab the diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 1ea6e4c..e077c84 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -33,6 +33,27 @@ "vite": "^8.0.5" } }, + "node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@emnapi/wasi-threads": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", @@ -1314,7 +1335,6 @@ "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", "devOptional": true, "license": "MIT", - "peer": true, "dependencies": { "@types/prop-types": "*", "csstype": "^3.2.2" @@ -1326,7 +1346,6 @@ "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", "devOptional": true, "license": "MIT", - "peer": true, "peerDependencies": { "@types/react": "^18.0.0" } @@ -1358,9 +1377,9 @@ } }, "node_modules/@wailsio/runtime": { - "version": "3.0.0-alpha.94", - "resolved": "https://registry.npmjs.org/@wailsio/runtime/-/runtime-3.0.0-alpha.94.tgz", - "integrity": "sha512-jtOtyWLDLop9NfU373sA43NjyGntxDFUIHY6kzmArz5HGn66Ok3vl9N2nIyVs7cArvADxk/mBBZ9wXOX7R0NFA==", + "version": "3.0.0-alpha.95", + "resolved": "https://registry.npmjs.org/@wailsio/runtime/-/runtime-3.0.0-alpha.95.tgz", + "integrity": "sha512-ODhaZYRrtRvwi6cfGEj4L+Ut9od9zTd7GH1BrAaONxlBYM4d31d3YG982HSZiktmIE2SqvyhTciY4sV5FbIfqA==", "license": "MIT" }, "node_modules/aria-hidden": { @@ -1800,7 +1819,6 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1841,7 +1859,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -1854,7 +1871,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", "license": "MIT", - "peer": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -2105,7 +2121,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.0.tgz", "integrity": "sha512-BuJcQK/56NQTWDGn4ABea3q4SSBdNPWwNZKTkkUpcMPnLoquSYH8llRtSUIgoL1KSCpHt5eghLShn50mH36y7Q==", "license": "MIT", - "peer": true, "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", diff --git a/go.mod b/go.mod index 8921179..d94f357 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25.0 require ( github.com/gen2brain/malgo v0.11.25 - github.com/wailsapp/wails/v3 v3.0.0-alpha2.105 + github.com/wailsapp/wails/v3 v3.0.0-alpha2.109 github.com/zalando/go-keyring v0.2.8 golang.org/x/sys v0.44.0 modernc.org/sqlite v1.53.0 @@ -15,7 +15,6 @@ require ( github.com/coder/websocket v1.8.14 // indirect github.com/danieljoos/wincred v1.2.3 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/ebitengine/purego v0.9.1 // indirect github.com/go-ole/go-ole v1.3.0 // indirect github.com/godbus/dbus/v5 v5.2.2 // indirect github.com/google/uuid v1.6.0 // indirect @@ -24,7 +23,7 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/ncruces/go-strftime v1.0.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - github.com/wailsapp/wails/webview2 v1.0.24 // indirect + github.com/wailsapp/wails/webview2 v1.0.27 // indirect modernc.org/libc v1.73.4 // indirect modernc.org/mathutil v1.7.1 // indirect modernc.org/memory v1.11.0 // indirect diff --git a/go.sum b/go.sum index e71bc34..0c35b31 100644 --- a/go.sum +++ b/go.sum @@ -8,8 +8,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/ebitengine/purego v0.9.1 h1:a/k2f2HQU3Pi399RPW1MOaZyhKJL9w/xFpKAg4q1s0A= -github.com/ebitengine/purego v0.9.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/gen2brain/malgo v0.11.25 h1:g0eMVeZIBvMRBbkVSR8p7ZafGFbxBcQERPa1GKHkg34= github.com/gen2brain/malgo v0.11.25/go.mod h1:xLVG3ROA33Bzol1quF3e4ehqcFuqh8QK4B8T6LQUs/M= github.com/go-json-experiment/json v0.0.0-20251027170946-4849db3c2f7e h1:Lf/gRkoycfOBPa42vU2bbgPurFong6zXeFtPoxholzU= @@ -44,10 +42,10 @@ github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/wailsapp/wails/v3 v3.0.0-alpha2.105 h1:KV2zqL9fOnX7o8goTwBAwBSfyT6MoZCTWofe3jSbOHM= -github.com/wailsapp/wails/v3 v3.0.0-alpha2.105/go.mod h1:GRW1qYl54Zi/w1mjCzDrMiy76g2BLfNlpqF640hgMf0= -github.com/wailsapp/wails/webview2 v1.0.24 h1:uULnjCSaRfMlU84mS3kjLgPsRosEOIusVK1nFOHZHzs= -github.com/wailsapp/wails/webview2 v1.0.24/go.mod h1:sdf+s0nAdxlzVWf9SCxC15XaxnQPJeY+uU1Ucn3jHQM= +github.com/wailsapp/wails/v3 v3.0.0-alpha2.109 h1:I2LX0NEzFn/p5yLJj53V3HzZ+5IWTNIEfU1BoWWGQWk= +github.com/wailsapp/wails/v3 v3.0.0-alpha2.109/go.mod h1:wrdvmyeCsB/K3YqJDoH8E3MwcN8NXAMnEFaDTW46w60= +github.com/wailsapp/wails/webview2 v1.0.27 h1:wjgAi/I8BBZ7kUGU8um3XF3ILEfzr96Q2Q1G4GPjMns= +github.com/wailsapp/wails/webview2 v1.0.27/go.mod h1:zdM4jcO1IaC61RiJL5F1BzgoqBHFIdacz8gPr5exr0o= github.com/zalando/go-keyring v0.2.8 h1:6sD/Ucpl7jNq10rM2pgqTs0sZ9V3qMrqfIIy5YPccHs= github.com/zalando/go-keyring v0.2.8/go.mod h1:tsMo+VpRq5NGyKfxoBVjCuMrG47yj8cmakZDO5QGii0= golang.org/x/mod v0.36.0 h1:JJjpVx6myfUsUdAzZuOSTTmRE0PfZeNWzzvKrP7amb4= diff --git a/main.go b/main.go index dc0b8ea..7b8f248 100644 --- a/main.go +++ b/main.go @@ -38,8 +38,11 @@ func main() { } // Any panic that unwinds to the main goroutine (e.g. inside the Wails event // loop) is written to the log with a full stack before the process dies, so a - // reproducible crash — like the multi-monitor drag — leaves a diagnosable - // trail instead of vanishing silently in a windowless GUI build. + // reproducible crash leaves a diagnosable trail instead of vanishing silently + // in a windowless GUI build. Note this does NOT catch the historic + // multi-monitor-drag crash: that was an os.Exit(1) from inside WebView2's + // error callback (upstream wails #5650), which bypasses deferred funcs and + // recover entirely — fixed by the alpha2.109 dependency bump, not here. defer logPanic() db, err := store.Open(dbPath())