Skip to content

fix(desktop-gpui): ask to restart for an update once, however often it is requested - #3938

Merged
richiemcilroy merged 3 commits into
mainfrom
fix/update-restart-prompt-once
Nov 9, 2026
Merged

richiemcilroy merged 3 commits into
mainfrom
fix/update-restart-prompt-once

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Every call to prompt_restart made while Cap is busy started its own 5-minute retry loop, and every loop re-armed itself until Cap went idle. A user who picked "Restart to update" a few times during a recording got that many "Restart now?" dialogs, one after another, once the recording ended (audit #7).

stateDiagram-v2
    [*] --> None
    None --> Waiting: busy
    None --> Showing: idle
    Waiting --> Waiting: busy request (ignored)
    Waiting --> Showing: idle request
    Waiting --> None: its own timer fires, then re-asks
    Showing --> None: dialog closed
Loading
  • UpdateScheduler holds one RestartPrompt (apps/desktop-gpui/src/updates.rs): None, Waiting(epoch) or Showing.
  • A request while a wait is pending joins it. A request once Cap is idle shows the dialog straight away, as before, and the pending wait is dropped: its timer only acts if the prompt is still Waiting with its own epoch.
  • A request while the dialog is open does nothing.
  • What the user sees for a single request is unchanged: the same dialog, and the same 5-minute wait while recording, exporting, importing or transcribing.
  • RestartPromptState holds the transitions (request, wait_elapsed, dialog_closed). restart_requests_share_one_wait_and_one_dialog walks a wait, an idle request that shows the dialog, the first wait's timer firing late, and a second wait that the first timer cannot consume. It fails with the old behaviour (every busy request arms another wait) and without the epoch check.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

The PR makes repeated restart requests share one wait or one dialog.

  • Repeated restart requests now share one update prompt.

Reviews (7) · Last reviewed commit: "test(desktop-gpui): cover the restart pr..." · Reviewed by Greptile

@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai review

Comment thread apps/desktop-gpui/src/updates.rs Resolved
@vercel
vercel Bot temporarily deployed to Preview – cap-status November 8, 2026 00:56 Inactive
@vercel

vercel Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Nov 8, 2026 11:37pm UTC

@richiemcilroy

Copy link
Copy Markdown
Member Author

@greptileai review

@richiemcilroy
richiemcilroy marked this pull request as ready for review November 8, 2026 01:13
@sandchest-com

sandchest-com Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Sandchest

Sandchest reviewed e9de71f: nothing exploitable found in this change.

Sandchest reviews every change for vulnerabilities an attacker could use · 1 credit · Review details

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@vercel
vercel Bot temporarily deployed to Preview – cap-status November 8, 2026 23:37 Inactive

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capy found no issues.

Open in Capy

@richiemcilroy
richiemcilroy merged commit 7c46a71 into main Nov 9, 2026
53 checks passed

This branch was previously deployed

1 inactive deployment
Preview – cap-status — e9de71fb Deployed Nov 8, 2026 by vercel[bot]
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.

2 participants