Skip to content

Fix/window not found noise - #5914

Open
julianstorer wants to merge 2 commits into
wailsapp:masterfrom
juggler-ai:fix/window-not-found-noise
Open

Fix/window not found noise#5914
julianstorer wants to merge 2 commits into
wailsapp:masterfrom
juggler-ai:fix/window-not-found-noise

Conversation

@julianstorer

@julianstorer julianstorer commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

handleWindowEvent logs a warning whenever a queued window event refers to a
window that's no longer in the manager. That lookup miss is a normal part of
the window lifecycle, not a fault:

  • The default Common.WindowClosing listener removes the window from the
    manager immediately, but AppKit keeps posting windowWillClose,
    windowDidResignKey etc. for the same NSWindow. Because
    events_darwin.go's hasListeners is a placeholder that always returns
    true, each of those is 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 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

  • Bug fix (non-breaking change which fixes an issue)

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.

  • Windows
  • macOS
  • Linux

Summary by CodeRabbit

  • Bug Fixes
    • Reduced log severity for unrecognized window events, preventing unnecessary warning messages while preserving diagnostic details in debug logs.

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.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c8ec21f-34d3-4a7d-9bf1-b9ba9e71027a

📥 Commits

Reviewing files that changed from the base of the PR and between f80dad5 and a905fbe.

📒 Files selected for processing (1)
  • v3/pkg/application/application.go

Walkthrough

The window event handler now logs events for missing windows at debug level instead of warning level before returning.

Changes

Window event logging

Layer / File(s) Summary
Missing-window event handling
v3/pkg/application/application.go
Expected post-removal and shutdown events now emit debug messages instead of warnings.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: leaanthony, taliesin-ai

Poem

A rabbit checks the window queue,
Finds no pane, and logs it true.
No warning thumps across the hall,
Just debug whispers, soft and small.
Shutdown hops away.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the change to reduce noise from missing-window logs.
Description check ✅ Passed The description explains the bug, motivation, non-breaking fix, and macOS testing, but omits the issue link, wails doctor output, and checklist selections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant