Skip to content

Studio drafts: two P3s left after the one-owner send #207

Open

Description

@AojdevStudio

Two P3s from Sol's last review of #201 (964383e..361b3c5), shipped as known. #205 records them, but closes when #201 merges, so this issue tracks them.

  1. Development builds only. React StrictMode reads the saved state twice at startup. If the second read answers late, after the person sent a start-screen picture, the start-screen picture merge brings that picture back. No path in the packaged app was found. Project drafts are not affected. (src/studio/StudioApp.tsx, takeState)
    • Fix: let the start picture merge take part only in the first state read.
  2. Normal use, disk only. Store.startedDrafts() returns every recorded start draft, completed sends included. So the start-up cleanup keeps a first message's original pasted pictures forever, after the send has copied them into the project. It costs disk space and brings back no draft. (sidecar/src/store.ts, startedDrafts)
    • Fix: drop a recorded start draft once its message is committed, or keep only those whose message is not.

Each needs a test written first.

Activity

  1. pullfrog commented on Nov 8, 2026

    @pullfrog

    Implementation plan

    This is a follow-up to #205, not a duplicate: #201 implements the ownership redesign and explicitly defers these two findings. Start from #201’s merged result or its current head (361b3c5); main does not yet contain these paths.

    1. Write a window regression test with two startup state.get responses: send a start-screen picture before the second response arrives, then assert it does not return. Preserve the existing case where the first late response restores an unsent picture. Restrict the start-picture merge in takeState to the first startup read, including under StrictMode.
    2. Write sidecar tests for cleanup after a committed first send and after a crash before commit, including retry after a lost response or restart. Release the recorded draft’s picture references only after the message commit, while retaining the revision-to-project mapping needed by startProject and idempotent retries; protect pictures for uncommitted sends and other live drafts. Account for existing records when cleaning up.
    3. Run the Studio window and sidecar suites, including the existing late-state and interrupted-send tests. Verify that cleanup respects the one-day grace period and never removes project copies.

    Pullfrog  | Implement a fix ➔ | View workflow run | via Pullfrog | Using gpt-6.1-terra | 𝕏

  2. AojdevStudio commented on Nov 8, 2026

    @AojdevStudio
    OwnerAuthor

    A third P3 from Sol's review of #201 at 05144bd: if the first read of the saved state is still on its way when the engine comes back, a second read starts beside it (src/studio/StudioApp.tsx, the ready handler). Both can hold the same saved start-screen picture. If the person sends that picture after the first answer, the later answer brings it back on the start screen. The timing window is narrow, and it sends no text the person did not click. Fix: let only one first read be on its way at a time, and drop an answer that arrives after a send from the start screen.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions