Repository navigation
🤖 tests: wait for the local window to show before the remote popup clipboard test - #6036
Merged
Merged
Conversation
…ipboard test The local window shows itself late, on ready-to-show. Under Xvfb with no window manager, that show() takes focus from the remote popup, and the clipboard permission handler grants a write only to the focused window. Wait for the local window to be visible before connecting. Fixes #5993
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5993
Cause
remoteConnection.spec.ts:284("remote app popups and blob attachments retain isolation and close on disconnect") connects to the remote server as soon as the preload API exists. At that point the local main window can still be hidden: it is created withshow: falseand callsshow()later, onready-to-show(src/desktop/main.ts).CI runs Electron under
xvfb-run, with no window manager. There, that lateshow()also takes focus away from the remote popup that the test just focused. The clipboard permission handler grants a write only to the focused window (allowClipboardWriteinsrc/desktop/remoteConnectionManager.ts), so it denies the popup'snavigator.clipboard.writeText: "NotAllowedError: ... Write permission denied." Whether the test fails depends on whenready-to-showlands. Every CI sighting failed in the second popup (desktop.html).This is a test race, not a product bug: a user cannot start a remote connection before the main window shows.
Fix
Test-only. Before connecting, the test waits until the local window is visible, the same poll this spec already uses after disconnect. The window shows only once per launch, so the wait also covers the second popup. No retries and no longer timeouts.
Proof
Local Xvfb (docker, no window manager, like
xvfb-run),make buildapp,--workers=1 --retries=0::284x20Write permission deniedat:340):284x20A probe that logged each window's focus showed the local window becoming visible and focused while the popup lost focus. With a 500 ms pause before the click, main failed 5 of 5, and the fix passed 5 of 5.
make static-checkpasses.Out of scope
One #5993 sighting also failed
remoteConnection.spec.ts:84at line 176 (the "Finish sign in" click on the auth popup). I did not reproduce it in local runs of the whole spec file, and this PR does not change it.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$212.61