Skip to content

🤖 tests: wait for the local window to show before the remote popup clipboard test - #6036

Merged
ThomasK33 merged 1 commit into
mainfrom
fix/5993-wait-local-window-shown
Oct 10, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
fix/5993-wait-local-window-shown

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

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 with show: false and calls show() later, on ready-to-show (src/desktop/main.ts).

CI runs Electron under xvfb-run, with no window manager. There, that late show() 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 (allowClipboardWrite in src/desktop/remoteConnectionManager.ts), so it denies the popup's navigator.clipboard.writeText: "NotAllowedError: ... Write permission denied." Whether the test fails depends on when ready-to-show lands. 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 build app, --workers=1 --retries=0:

Run Result
main, :284 x20 3 failed, 17 passed (all Write permission denied at :340)
this branch, :284 x20 20 passed
this branch, whole spec file x5 15 passed

A 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-check passes.

Out of scope

One #5993 sighting also failed remoteConnection.spec.ts:84 at 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

…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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T10:03:18.665667Z 3cc49a5 PR opened
🔒 Security Review ✅ Completed 2026-10-10T10:04:03.276022Z 3cc49a5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 10, 2026
Merged via the queue into main with commit 000dc34 Oct 10, 2026
31 checks passed
@ThomasK33
ThomasK33 deleted the fix/5993-wait-local-window-shown branch October 10, 2026 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🤖 tests: remoteConnection.spec.ts popup clipboard write is denied on Linux E2E (flaky)

1 participant