Skip to content

Edits: a clip's edit and its cover are saved separately and can disagree after a crash #273

Closed

Description

@morepriyam

Raised in review on #240 (src/db/drafts.ts, saveEdit).

What happens

Saving a clip edit writes the edit first and its new cover (thumbnail) after it, once the cover is rendered (160–600 ms on a Galaxy S24). If the app stops in between (killed, crashes, phone off), the clip keeps the edit with the previous edit's cover. Home and the recorder then show the wrong frame until the clip is edited again. Clearing the cover isn't enough: the fallback thumbnail is the original video's first frame, without the edit.

From reading the code; not reproduced.

Fix

Render the cover first, then save the edit and its cover in one write. The editor applies edits on screen at once (optimistic), so waiting for the cover before the write isn't visible there.

The write needs a guard so an older edit can't land after a newer one (two edits saved close together, the older one's cover finishing last): for example, save only when the row still holds the edit that was there when this save started, or keep a per-clip revision.

Done when

At any point the app can stop, a clip's stored edit and its cover match, and a later edit always wins over an earlier one.

Activity

  1. added a commit that references this issue on Oct 15, 2026
    889ac37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions