Skip to content

[Bug]: Finishing a pairing link closes a newly opened Create link dialog #39578

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open Settings → Sharing & access for a backend on a slow connection.
  2. Click Create link under Authorized clients.
  3. Submit the form.
  4. Press Escape while the dialog says Creating…
  5. Click Create link again before the first request finishes.
  6. Wait for the first link to appear under Authorized clients.

Expected behavior

The first link appears and the newly opened dialog stays open.

Actual behavior

The first link appears and closes the newly opened dialog.

after first link finishes

failure

Impact

Minor bug or occasional failure. Anyone who reopens the form during a slow link creation has to open it again when the first request finishes.

Version or commit

main at d6cdb4f161. The cause is at apps/web/src/components/settings/AuthorizedClientsSettings.tsx:645.

Environment

Linux x64 boat.dev default machine, a fresh checkout.

Logs or stack traces

The reopened Create link dialog remains open
Automated repro

Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.

diff --git a/scripts/scenarios/pairing-completion-keeps-reopened-dialog.e2e.ts b/scripts/scenarios/pairing-completion-keeps-reopened-dialog.e2e.ts
new file mode 100644
index 0000000000..864d848870
--- /dev/null
+++ b/scripts/scenarios/pairing-completion-keeps-reopened-dialog.e2e.ts
@@ -0,0 +1,56 @@
+import { expect } from "e2e";
+
+import { test, WEB } from "./t3.ts";
+
+test(
+  "Finishing a pairing link leaves a reopened Create link dialog open",
+  WEB,
+  async ({ t3, app, browser, screen }) => {
+    await t3.project("demo");
+    const pairingToken = "**/api/auth/pairing-token";
+    const requested = Promise.withResolvers<void>();
+    const release = Promise.withResolvers<void>();
+    await browser.route(pairingToken, async (route) => {
+      if (route.request.method !== "POST") return route.fallback();
+      requested.resolve();
+      // Simulate a delayed request without replacing the server's response.
+      await release.promise;
+      await route.continue();
+    });
+
+    await t3.open("/settings/access");
+    const authorizedClients = browser.locator("#authorized-clients");
+    const open = authorizedClients.getByRole("button", "Create link", { exact: true });
+    const dialog = screen.getByRole("dialog", "Create pairing link", { exact: true });
+    const label = "Waiting tablet";
+    try {
+      await open.tap();
+      await dialog.getByPlaceholder("e.g. Living room iPad").fill(label);
+      await dialog.getByRole("button", "Create link", { exact: true }).tap();
+      await requested.promise;
+      await dialog.getByRole("button", "Creating…", { exact: true }).waitFor();
+      await browser.keyboard.press("Escape");
+
+      const openPopup = browser
+        .locator('[data-slot="dialog-popup"][data-open]')
+        .getByRole("heading", "Create pairing link", { exact: true });
+      const dismissed = !(await openPopup.isVisible());
+      if (dismissed) {
+        await dialog.waitFor({ state: "hidden" });
+        await open.tap();
+        await dialog.waitFor();
+      }
+
+      release.resolve();
+      await authorizedClients.getByText(label, { exact: true }).waitFor();
+      await app.screenshot("after-first-link-finishes");
+      expect(
+        !dismissed || (await openPopup.isVisible()),
+        "The reopened Create link dialog remains open",
+      ).toBe(true);
+    } finally {
+      release.resolve();
+      await browser.unroute(pairingToken);
+    }
+  },
+);
pnpm scenarios:prove scripts/scenarios/pairing-completion-keeps-reopened-dialog.e2e.ts --base main

Workaround

No response

Activity

  1. added
    vouch:trusted
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions