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
- Make an uncommitted edit to a tracked file in a project with two open pull requests.
- Open a new thread in that project.
- Open the branch picker.
- Enter the first pull request number.
- Choose Checkout pull request.
- Click Local after the pull request resolves.
- Replace the number with the second pull request number after the checkout fails.
- Wait for the second pull request title to appear.
Expected behavior
The dialog shows the second pull request without the first checkout's error.
Actual behavior
The dialog shows the second pull request alongside an error that still names the first.
Impact
Minor bug or occasional failure. Anyone who switches references in the same dialog after a failed checkout sees stale feedback until they try another checkout or close the dialog.
Version or commit
main at 59651c1761. The cause is at apps/web/src/components/PullRequestThreadDialog.tsx:199.
Environment
Linux x64 boat.dev default machine, a fresh checkout.
Logs or stack traces
The second pull request does not display the first checkout errorAutomated repro
Fails in 2 of 2 runs on main: apply the patch with git apply, then run the command.
diff --git a/scripts/scenarios/pull-request-checkout-error-follows-reference.e2e.ts b/scripts/scenarios/pull-request-checkout-error-follows-reference.e2e.ts
new file mode 100644
index 0000000000..b8656e05df
--- /dev/null
+++ b/scripts/scenarios/pull-request-checkout-error-follows-reference.e2e.ts
@@ -0,0 +1,90 @@
+/// <reference lib="dom" />
+import type { GitResolvePullRequestResult } from "@t3tools/contracts";
+import { expect } from "e2e";
+
+import { test, WEB } from "./t3.ts";
+
+test(
+ "A failed local checkout does not show its error on another pull request",
+ WEB,
+ async ({ t3, app, browser, screen }) => {
+ await t3.project("demo");
+ await browser.setViewport({ width: 1280, height: 800 });
+ await browser.addInitScript(() => {
+ const send = WebSocket.prototype.send;
+ WebSocket.prototype.send = function (data) {
+ const request: {
+ _tag: string;
+ id: string;
+ tag: string;
+ payload: { cwd: string; reference: string };
+ } | null = typeof data === "string" ? JSON.parse(data) : null;
+ if (request?._tag !== "Request") return send.call(this, data);
+ const reply = (exit: unknown) =>
+ queueMicrotask(() =>
+ this.dispatchEvent(
+ new MessageEvent("message", {
+ data: JSON.stringify({ _tag: "Exit", requestId: request.id, exit }),
+ }),
+ ),
+ );
+ if (request.tag === "git.resolvePullRequest") {
+ const number = Number(request.payload.reference.replace(/^#/, ""));
+ const value: GitResolvePullRequestResult = {
+ pullRequest: {
+ number,
+ title: number === 42 ? "Update the release notes" : "Fix the status badge",
+ url: `https://github.com/example/demo/pull/${number}`,
+ baseBranch: "main",
+ headBranch: `change-${number}`,
+ state: "open",
+ },
+ };
+ reply({ _tag: "Success", value });
+ return;
+ }
+ if (request.tag === "git.preparePullRequestThread") {
+ reply({
+ _tag: "Failure",
+ cause: [
+ {
+ _tag: "Fail",
+ error: {
+ _tag: "GitManagerError",
+ operation: "preparePullRequestThread",
+ cwd: request.payload.cwd,
+ detail:
+ "This repository has uncommitted changes. Commit or stash them before checking out pull request #42 here, or check it out in its own folder.",
+ },
+ },
+ ],
+ });
+ return;
+ }
+ return send.call(this, data);
+ };
+ });
+
+ await t3.open("/");
+ await browser
+ .locator('[data-slot="combobox-trigger"][aria-label^="Branch:"]:visible')
+ .first()
+ .click();
+ await screen.getByPlaceholder("Search refs...").fill("#42");
+ const checkoutLabel = /Checkout (?:pull|change) request/i;
+ await screen.getByRole("option", checkoutLabel).tap();
+
+ const dialog = screen.getByRole("dialog", checkoutLabel);
+ await dialog.getByText("Update the release notes", { exact: true }).waitFor();
+ await dialog.getByRole("button", "Local", { exact: true }).tap();
+ const previousError = dialog.getByText(/before checking out pull request #42 here/);
+ await previousError.waitFor();
+ await dialog.getByRole("textbox").fill("#43");
+ await dialog.getByText("Fix the status badge", { exact: true }).waitFor();
+ await app.screenshot("second-pull-request");
+ expect(
+ await previousError.isVisible(),
+ "The second pull request does not display the first checkout error",
+ ).toBe(false);
+ },
+);pnpm scenarios:prove scripts/scenarios/pull-request-checkout-error-follows-reference.e2e.ts --base mainWorkaround
No response
Metadata
Metadata
Assignees
Labels
vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.


Activity