Fix/window not found noise - #5914
Conversation
handleWindowEvent warns whenever a queued window event refers to a window
that's no longer in the manager, but that miss is a normal part of the
lifecycle rather than a bug:
- The default Common.WindowClosing listener removes the window from the
manager straight away. AppKit keeps posting windowWillClose,
windowDidResignKey and friends for the same NSWindow, and because
events_darwin.go's hasListeners is a placeholder that always returns
true, each of those gets queued and then warns after the window is
already gone.
- App.cleanup tears every window down and nils a.windows, so any
in-flight events hit the same miss.
The upshot is a warning on every window close in a multi-window app and on
every quit, none of it actionable. Demote it to debug so the lookup miss is
still there when debugging without polluting normal output.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe window event handler now logs events for missing windows at debug level instead of warning level before returning. ChangesWindow event logging
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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 |
Description
handleWindowEventlogs a warning whenever a queued window event refers to awindow that's no longer in the manager. That lookup miss is a normal part of
the window lifecycle, not a fault:
Common.WindowClosinglistener removes the window from themanager immediately, but AppKit keeps posting
windowWillClose,windowDidResignKeyetc. for the sameNSWindow. Becauseevents_darwin.go'shasListenersis a placeholder that always returnstrue, each of those is queued and then warns after the window is already gone.
App.cleanuptears every window down and nilsa.windows, so any in-flightevents hit the same miss.
The result is a warning on every window close in a multi-window app and on every
quit, none of it actionable. This demotes it to a debug log, keeping the miss
visible when debugging without spamming normal output.
Type of change
How Has This Been Tested?
Opened and closed windows in a multi-window app and quit the app; confirmed the
warning no longer appears at the default log level.
Summary by CodeRabbit