Skip to content

fix: remove duplicate update-ready toast listener#87

Merged
VariableThe merged 1 commit into
mainfrom
refactor/replace-expr-eval
Jun 29, 2026
Merged

fix: remove duplicate update-ready toast listener#87
VariableThe merged 1 commit into
mainfrom
refactor/replace-expr-eval

Conversation

@VariableThe

@VariableThe VariableThe commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes duplicate "Restart Now" toast notifications when an update is ready to install.

Root Cause

The backend emits both update-status (with status: "ready") and the legacy update-ready event when a download completes. The frontend had two separate listeners in App.tsx that each created the same toast — resulting in two "Restart Now" notifications stacked on top of each other.

Change

  • Removed the legacy onUpdateReady listener in App.tsx (lines 80-89) and its cleanup
  • The onUpdateStatus/ ready handler (kept) now fires the toast once, as intended

Summary by CodeRabbit

  • Bug Fixes
    • Streamlined update notifications so the app now handles “update ready” events through a single listener, helping ensure the restart prompt appears reliably.
    • Improved cleanup when the app closes or refreshes by removing an extra listener, reducing the chance of stale update notifications.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5445cd8d-ccc1-45e5-b527-6d6d1ec59808

📥 Commits

Reviewing files that changed from the base of the PR and between cce86ed and 9c76b43.

📒 Files selected for processing (1)
  • src/App.tsx
💤 Files with no reviewable changes (1)
  • src/App.tsx

📝 Walkthrough

Walkthrough

In src/App.tsx, the onUpdateReady IPC listener and its cleanup (disposeUpdateReady()) are removed from the main useEffect. The "ready" update toast is now handled exclusively by the existing onUpdateStatus listener that checks for payload.status === 'ready'.

Changes

Update listener consolidation

Layer / File(s) Summary
Remove onUpdateReady registration and cleanup
src/App.tsx
Removes the onUpdateReady listener call and eliminates disposeUpdateReady() from the useEffect cleanup; the onUpdateStatus handler already covers the ready status.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit tidied up the wires one day,
Two listeners doing one job? No way!
onUpdateReady hopped right out the door,
onUpdateStatus handles it—no more.
Clean code blooms like clover in May! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: removing the duplicate update-ready toast listener.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/replace-expr-eval

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@VariableThe VariableThe merged commit bb81660 into main Jun 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant