Repository navigation
Done
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 two T3 Code web tabs on the same address with an empty stash.
- In the first tab, use the stash shortcut with an empty composer to open the stash menu.
- In the second tab, type a prompt in the composer.
- Use the stash shortcut in the second tab to save the prompt.
- Return to the first tab and look at its stash menu.
Expected behavior
The saved prompt appears in the open stash menu and can be restored.
Actual behavior
The first tab still says nothing is stashed. Reloading shows the saved prompt.
Impact
Minor bug or occasional failure. People who stash a prompt in one tab and try to restore it from another already open tab encounter a stale list.
Version or commit
main at 9fdcd08835. The cause is at apps/web/src/promptStashStore.ts:222.
Environment
Linux x64 boat.dev default machine, a fresh checkout.
Logs or stack traces
Restore stashed prompt: Draft from the other tabAutomated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/scripts/scenarios/stashed-prompt-appears-in-open-tab.e2e.ts b/scripts/scenarios/stashed-prompt-appears-in-open-tab.e2e.ts
new file mode 100644
index 0000000000..21f5e96187
--- /dev/null
+++ b/scripts/scenarios/stashed-prompt-appears-in-open-tab.e2e.ts
@@ -0,0 +1,44 @@
+/// <reference lib="dom" />
+import { expect } from "e2e";
+
+import { test, WEB } from "./t3.ts";
+
+test(
+ "A prompt stashed in another tab appears in the open stash menu",
+ WEB,
+ async ({ t3, app, browser, screen }) => {
+ const project = await t3.project("demo");
+ const reader = await t3.thread({ project, title: "Reading", messages: ["first"] });
+ const writer = await t3.thread({ project, title: "Writing", messages: ["second"] });
+ await t3.open(reader);
+
+ await screen.getByTestId("composer-editor").tap();
+ await browser.keyboard.press("Control+s");
+ await screen.getByRole("list", "Stashed prompts").waitFor();
+
+ // A second signed-in document shares storage while keeping its own app state.
+ await browser.evaluate((threadId) => {
+ const frame = document.createElement("iframe");
+ frame.id = "second-client";
+ frame.src = location.pathname.replace(/[^/]+$/, threadId);
+ frame.style.cssText =
+ "position:fixed;inset:0;width:100%;height:100%;border:0;z-index:2147483647";
+ document.body.append(frame);
+ return null;
+ }, writer.threadId);
+
+ const other = browser.frameLocator("#second-client");
+ const editor = other.getByTestId("composer-editor");
+ const prompt = "Draft from the other tab";
+ await editor.fill(prompt);
+ await browser.keyboard.press("Control+s");
+ await other.getByRole("button", "Stashed prompts: 1. Open stash.").waitFor();
+ await browser.evaluate(() => {
+ document.querySelector("#second-client")?.remove();
+ return null;
+ });
+
+ await app.screenshot("stash-after-other-tab-saves");
+ await expect(screen.getByRole("button", `Restore stashed prompt: ${prompt}`)).toBeVisible();
+ },
+);pnpm scenarios:prove scripts/scenarios/stashed-prompt-appears-in-open-tab.e2e.ts --base mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity