fix(display/webkit): WindowExists unwraps the query's typed nil - #43
Conversation
queryWindowByName answers a miss with a typed-nil *WindowInfo inside the Result, and a typed nil passes an interface nil-check — so WindowExists said yes for every name that was ever asked about. Callers then took warm-window paths (set_url, resize, restore) against windows that were never created; lthn/desktop's tear-off failed on exactly this. The new Ugly case registers a query handler answering the production miss shape and pins the unwrap. Co-Authored-By: Virgil <virgil@lethean.io>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesWindow existence validation
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
queryWindowByName wraps a miss as a typed-nil
*WindowInfoinResult.Value; the interface nil-check inWindowExiststherefore returned true for every name. Downstream, lthn/desktop's tear-off always took the warm-window path against windows that were never created and failed atwindow.set_url.Fix unwraps the value; the new
TestWindowHelpersBehaviour_WindowExists_Uglyregisters the production miss shape and fails against the old code.Gate:
GOWORK=off go test ./display/webkit/...all green, vet clean, gofmt clean.🤖 Generated with Claude Code
Co-Authored-By: Virgil virgil@lethean.io
Summary by CodeRabbit
Bug Fixes
Tests