@devries-cameron20 / t3code-1 / commits / 86ec940ad3
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): a failed archive or delete keeps the earlier Undo (#29628)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>

Alex Southwell committed Nov 15, 2026 at 02:05 UTC 86ec940ad3e825a15f85f34063c4329116483da8
2 files changed +16 -3
apps/mobile/src/features/home/useThreadListActions.test.ts
+13
@@ -594,6 +594,19 @@ describe("thread action undo", () => {
594 await undo();
595 expect(state.requests.map(({ action }) => action)).toEqual(["unpin"]);
596 });
597 +
598 + it("keeps the earlier Undo until archiving succeeds", async () => {
599 + const actions = useThreadListActions();
600 + const thread = makeThread();
601 + await actions.settleThread(thread);
602 + state.failedAction = "archive";
603 + expect(await actions.archiveThread(thread)).toBe(false);
604 + expect(readThreadUndoNotice()?.action).toBe("Settled");
605 +
606 + state.failedAction = null;
607 + expect(await actions.archiveThread(thread)).toBe(true);
608 + expect(readThreadUndoNotice()).toBeNull();
609 + });
610 });
611
612 describe("thread archive guard", () => {
apps/mobile/src/features/home/useThreadListActions.ts
+3 -3
@@ -145,9 +145,6 @@ function useThreadActionExecutor(
145 return false;
146 }
147 if (action === "unsettle") ThreadUndo.invalidate("settle", key);
148 - if (action === "archive" || action === "delete") {
149 - for (const kind of ["settle", "snooze", "pin"]) ThreadUndo.invalidate(kind, key);
150 - }
148 onStarted?.();
149 const result = await withThreadDismissal(
150 key,
@@ -177,6 +174,9 @@ function useThreadActionExecutor(
174 Dialog.alert(actionFailureTitle(action), actionFailureMessage(action, result.cause));
175 return false;
176 }
177 + if (action === "archive" || action === "delete") {
178 + for (const kind of ["settle", "snooze", "pin"]) ThreadUndo.invalidate(kind, key);
179 + }
180 if (action === "archive" || action === "unarchive" || action === "delete") {
181 refreshArchivedThreadsForEnvironment(thread.environmentId);
182 }