fix(updater): keep update indicator until install - #33
Conversation
📝 WalkthroughWalkthroughThe update indicator now remains visible while an update is available. Opening About does not acknowledge the update. Successful installation clears the persisted update state. Unit and end-to-end tests cover this behavior. ChangesUpdate indicator lifecycle
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
e2e/settings.e2e.ts (1)
174-179: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winWait for relaunch before asserting the indicator is hidden.
The test waits only for
plugin:updater|install. If relaunch fails after the indicator is cleared, this test still passes. Also verify thatplugin:process|restartis invoked after installation.Suggested assertion
await expect.poll(() => page.evaluate(() => ( window as unknown as { __TAURI_TEST_COMMANDS__: string[] } ).__TAURI_TEST_COMMANDS__)).toContain("plugin:updater|install"); + await expect.poll(() => page.evaluate(() => { + const commands = (window as unknown as { + __TAURI_TEST_COMMANDS__: string[]; + }).__TAURI_TEST_COMMANDS__; + return commands.indexOf("plugin:process|restart") > + commands.indexOf("plugin:updater|install"); + })).toBe(true); await expect(page.locator("`#about-update-dot`")).toBeHidden();🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e/settings.e2e.ts` around lines 174 - 179, Update the updater flow assertions after clicking “安装并重启” to wait for both the installation command and the subsequent “plugin:process|restart” command, then assert `#about-update-dot` is hidden only after the restart command is observed. Keep the existing installation assertion and locator behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@e2e/settings.e2e.ts`:
- Around line 174-179: Update the updater flow assertions after clicking “安装并重启”
to wait for both the installation command and the subsequent
“plugin:process|restart” command, then assert `#about-update-dot` is hidden only
after the restart command is observed. Keep the existing installation assertion
and locator behavior unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e4370e3e-b54f-48d5-be45-381adfca86ff
📒 Files selected for processing (4)
e2e/settings.e2e.tssrc/settings.tssrc/update-indicator.test.tssrc/update-indicator.ts
Summary
Why
The indicator previously represented an unseen update. Merely opening the About page marked the update as seen and removed the orange dot, even though the update had not been downloaded or installed. This made the persistent update signal disappear too early and made it easy to forget that an update was still pending.
The indicator now represents update availability instead of whether the user has viewed the notification.
Compatibility
Existing version 1 update state remains readable. A previously persisted seenVersion value no longer suppresses the indicator, so users who already opened the About page will still see the dot while that update is available. The state is invalidated normally after the app version changes.
Behavior
Tests
Summary by CodeRabbit