Skip to content

Commit f4a31b6

Browse files
author
nedtwigg
committed
Claude Code review R1: fix post-install markers blocking update check, remove unused plugin-process dep, fix spec inconsistencies
1 parent b33211d commit f4a31b6

File tree

5 files changed

+7
-22
lines changed

5 files changed

+7
-22
lines changed

docs/specs/auto-update.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,11 @@ The `check()` call handles endpoint fetching, version comparison, and signature
193193
|------|----------------|
194194
| `standalone/src/updater.ts` | Update check, background download, quit-time install, post-install markers, state |
195195
| `standalone/src/UpdateBanner.tsx` | Banner React component |
196-
| `standalone/src/App.tsx` | Mounts `<UpdateBanner />` at the top of the app |
196+
| `standalone/src/main.tsx` | Mounts `<UpdateBanner />` at the top of the app |
197197

198198
The updater module is standalone-only — it does not go into `lib/` because the VSCode extension and website have no use for it.
199199

200200
## Setup required
201201

202-
1. `pnpm --filter mouseterm-standalone add @tauri-apps/plugin-updater @tauri-apps/plugin-process`
203-
2. Add `"process"` to the `plugins` allowlist in `tauri.conf.json` if not already present.
204-
3. Add `"installMode": "passive"` to the updater Windows config in `tauri.conf.json`.
202+
1. `pnpm --filter mouseterm-standalone add @tauri-apps/plugin-updater`
203+
2. Add `"installMode": "passive"` to the updater Windows config in `tauri.conf.json`.

pnpm-lock.yaml

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

standalone/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"dependencies": {
1414
"@phosphor-icons/react": "^2.1.10",
1515
"@tauri-apps/api": "^2.0.0",
16-
"@tauri-apps/plugin-process": "^2.3.1",
1716
"@tauri-apps/plugin-shell": "^2.0.0",
1817
"@tauri-apps/plugin-updater": "^2.10.1",
1918
"@xterm/addon-fit": "^0.11.0",

standalone/src/updater.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,14 @@ describe('updater', () => {
8080
expect(localStorage.getItem(STORAGE_KEY)).toBeNull();
8181
});
8282

83-
it('skips update check when a post-install marker is present', async () => {
83+
it('still runs update check after reading a post-install marker', async () => {
8484
localStorage.setItem(STORAGE_KEY, JSON.stringify({ from: '0.3.0', to: '0.4.0' }));
8585

8686
startUpdateCheck();
87-
await vi.advanceTimersByTimeAsync(10_000);
87+
await vi.advanceTimersByTimeAsync(5_000);
88+
await vi.advanceTimersByTimeAsync(0);
8889

89-
expect(mocks.check).not.toHaveBeenCalled();
90+
expect(mocks.check).toHaveBeenCalledOnce();
9091
});
9192
});
9293

standalone/src/updater.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,13 @@ async function runUpdateCheck(): Promise<void> {
6868
const marker = JSON.parse(raw);
6969
if (marker.failed) {
7070
setState({ status: 'post-update-failure', version: marker.version });
71-
registerCloseHandler();
72-
return;
7371
} else if (marker.from && marker.to) {
7472
setState({ status: 'post-update-success', from: marker.from, to: marker.to });
7573
setTimeout(() => {
7674
if (state.status === 'post-update-success') {
7775
setState({ status: 'idle' });
7876
}
7977
}, 10_000);
80-
registerCloseHandler();
81-
return;
8278
}
8379
}
8480
} catch {

0 commit comments

Comments
 (0)