Repository navigation
Closed as not planned
Closed as not planned
Copy link
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 → Providers for a backend on a slow connection.
- Click Add provider.
- Select Codex.
- Click Continue with ChatGPT.
- Enter an account name.
- Click Continue.
- Press Escape while the button says Adding account…
Expected behavior
The setup stays open until the account is created so sign-in can continue.
Actual behavior
The setup closes immediately and a successful save leaves the new account unsigned in.
Impact
Minor bug or occasional failure. People who press Escape during a slow account creation have to return to the provider to start sign-in.
Version or commit
main at d6cdb4f161. The cause is at apps/web/src/components/settings/AddCodexAccountDialog.tsx:89.
Environment
Linux x64 boat.dev default machine, a fresh checkout.
Logs or stack traces
ChatGPT account setup stays open while adding the accountAutomated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/scripts/scenarios/adding-chatgpt-account-keeps-setup-open.e2e.ts b/scripts/scenarios/adding-chatgpt-account-keeps-setup-open.e2e.ts
new file mode 100644
index 0000000000..e530372c88
--- /dev/null
+++ b/scripts/scenarios/adding-chatgpt-account-keeps-setup-open.e2e.ts
@@ -0,0 +1,80 @@
+/// <reference lib="dom" />
+import { expect } from "e2e";
+
+import { test, WEB } from "./t3.ts";
+
+declare global {
+ interface Window {
+ chatGptAccountSave?: {
+ readonly started: Promise<void>;
+ readonly release: () => void;
+ };
+ }
+}
+
+test(
+ "Escape leaves ChatGPT account setup open while the account is being added",
+ WEB,
+ async ({ t3, app, browser, screen }) => {
+ await t3.project("demo");
+ await browser.addInitScript(() => {
+ const gate = Promise.withResolvers<void>();
+ const started = Promise.withResolvers<void>();
+ window.chatGptAccountSave = { started: started.promise, release: gate.resolve };
+ const send = WebSocket.prototype.send;
+ WebSocket.prototype.send = function (data) {
+ if (typeof data !== "string") return send.call(this, data);
+ const parsed = JSON.parse(data);
+ const messages = [parsed].flat();
+ const accountSave = (message: {
+ _tag?: string;
+ tag?: string;
+ payload?: { patch?: { providerInstances?: Record<string, { displayName?: string }> } };
+ }) =>
+ message?._tag === "Request" &&
+ message.tag === "server.updateSettings" &&
+ Object.values(message.payload?.patch?.providerInstances ?? {}).some(
+ (instance) => instance.displayName === "ChatGPT - Slow account",
+ );
+ const saves = messages.filter(accountSave);
+ if (saves.length === 0) return send.call(this, data);
+ const other = messages.filter((message) => !saves.includes(message));
+ if (other.length > 0) send.call(this, JSON.stringify(other));
+ started.resolve();
+ void gate.promise.then(() =>
+ send.call(this, Array.isArray(parsed) ? JSON.stringify(saves) : data),
+ );
+ };
+ });
+ await t3.open("/settings/providers?instanceId=codex");
+ await screen.getByRole("button", "Add provider", { exact: true }).first().tap();
+ const addProvider = screen.getByRole("dialog", "Add provider", { exact: true });
+ await addProvider.getByRole("radio", "Codex", { exact: true }).tap();
+ await addProvider.getByRole("button", "Continue with ChatGPT", { exact: true }).tap();
+
+ const setup = screen.getByRole("dialog", "Add ChatGPT account", { exact: true });
+ await setup.getByRole("textbox", "Account name", { exact: true }).fill("Slow account");
+ try {
+ await setup.getByRole("button", "Continue", { exact: true }).tap();
+ const adding = browser
+ .locator('[data-slot="dialog-popup"][data-open]')
+ .getByRole("button", "Adding account…", { exact: true });
+ await adding.waitFor();
+ await browser.evaluate(async () => {
+ await window.chatGptAccountSave!.started;
+ return null;
+ });
+ await browser.keyboard.press("Escape");
+ await app.screenshot("escape-during-account-creation");
+ expect(
+ await adding.isVisible(),
+ "ChatGPT account setup stays open while adding the account",
+ ).toBe(true);
+ } finally {
+ await browser.evaluate(() => {
+ window.chatGptAccountSave?.release();
+ return null;
+ });
+ }
+ },
+);pnpm scenarios:prove scripts/scenarios/adding-chatgpt-account-keeps-setup-open.e2e.ts --base mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity