Repository navigation
fix(desktop-gpui): retry Instant start cleanup so failed starts never leave empty caps - #3089
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
Member
Author
|
hey @greptileai, please re-review the PR |
richiemcilroy
marked this pull request as ready for review
October 24, 2026 12:04
Member
Author
|
hey @greptileai, please re-review the PR |
… never created, and recheck the journal before each delete
…keep the local copy if that fails
Member
Author
|
hey @greptileai, please re-review the PR |
… can be read, and never treat an unreadable journal as empty
Member
Author
|
hey @greptileai, please re-review the PR |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instant mode creates its share link on the server before capture starts. When a start fails or is cancelled after that point, the app deletes the server video. That delete can be skipped or lost, and the user is left with an empty cap stuck at "Uploading 0%" in their library. Today that happens when:
apps/desktop-gpui/src/session.rs:809), and dropping that task aborts the delete mid-flight;This adds a small cleanup journal for Instant videos whose recording never started, so the server copy is removed eventually.
flowchart TD A[Server creates Instant video] --> B["begin: journal entry, stage starting"] B --> C{Recording starts?} C -- yes --> D["started: entry removed"] C -- "start failed / cancelled" --> E[Delete server video] E -- ok --> F["resolved: entry removed"] E -- "error or aborted" --> G["abandon: entry due for retry"] C -- "crash, panic, quit" --> H["entry left from an earlier session, due after 30 min grace"] G --> S[Sweep at launch, then every 5 min] H --> S S --> J{Signed in to the same account and server?} J -- no --> W[Wait for a later sweep] J -- yes --> K{Local recording needs the video?} K -- yes --> L[Forget entry, keep video] K -- no --> M[Delete server video] M -- ok --> F M -- error --> N[Retry with backoff]How it works
beginrecords the video right after the server creates it (apps/desktop-gpui/src/recording.rs:2132).startedremoves it the moment recording activates (apps/desktop-gpui/src/session.rs:918); a successful delete removes it too.apps/desktop-gpui/src/recording.rs:2169,apps/desktop-gpui/src/session.rs:958). Entries left by an earlier app session count as interrupted, after a 30 minute grace period so another running copy of the app can finish its own start.apps/desktop-gpui/src/upload/instant_cleanup.rs:470) deletes due entries with backoff. Before deleting, it requires (locally_protected,apps/desktop-gpui/src/upload/instant_cleanup.rs:409):apps/desktop-gpui/src/upload/queue.rs). If it cannot, the local copy is kept even when "delete after upload" is on, so a later sweep can never find an uploaded video without its folder.Start, stop, discard, restart and delete behave as before. The journal only retries deletes the app was already making.
Visibility
The startup delete now sends a reason and, for failed starts, a coarse cause:
start-failed,start-cancelled,interruptedmicrophone,camera,capture,permission,storage,account,network,othergpuitoX-Cap-Desktop-Features.The web delete endpoint (
apps/web/app/api/desktop/[...route]/video.ts:448) ignores unknown values, deletes exactly as before, and only after a successful delete records adesktop_instant_cleanupanalytics event. Older servers ignore the extra query parameters, so the app works against any server version.

Confidence Score: 5/5
The PR appears safe to merge; no new blocking issue remains.Summary
Adds a saved cleanup journal that retries deletes for Instant recordings that never started.
Reviews (7) · Last reviewed commit: "fix(desktop-gpui): keep a crashed start'..." · Reviewed by Greptile