Repository navigation
Closed
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
Description
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
- Open Settings → Sharing & access for a backend on a slow connection.
- Click Create link under Authorized clients.
- Submit the form.
- Press Escape while the dialog says Creating…
- Click Create link again before the first request finishes.
- 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.
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 openAutomated 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 mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity