You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Edits: a clip's edit and its cover are saved separately and can disagree after a crash #273
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
fix(edits): a clip's edit and its cover are saved together