Skip to content

Fresh draft gains an extra empty paragraph after first reload #8

Description

@lsegal

A fresh browser with no saved draft ends up with an extra empty paragraph after the first reload.

Steps to reproduce

  1. Open the app in a new browser profile (empty IndexedDB).
  2. Type some text into the first paragraph and wait a moment.
  3. Reload.

Expected

The draft has the single paragraph that was edited.

Actual

After the reload, the draft has an extra empty paragraph besides the edited one. On main before #3 it came out as ["", "INT. HOUXY\nSE"], and with #3 as ["INT. HOUXY\nShe waits.SE", ""], so this predates #3. A likely cause: LocalProject.open runs twice against the same empty IndexedDB store (e.g. a React StrictMode double effect), and each run calls createDocument, so the two blank documents merge.

Acceptance criteria

  • Opening a fresh draft and reloading leaves exactly the paragraphs the user created.
  • A regression test covers opening the same empty project twice concurrently.

Addresses #1 and #3

Activity

  1. self-assigned this
    on Oct 3, 2026
  2. lsegal commented on Oct 3, 2026

    @lsegal
    ContributorAuthor

    Starting work on this issue /glorp:45E62B60

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions