Skip to content

id(world-replication): new feeds can receive a snapshot containing a storage-failed, never-durable mutation (PR #4589) #4724

Closed

Description

@dezren39

Finding (from PR review, never addressed)

After a journal storage failure, new replication feeds can still receive a signed snapshot containing a mutation that was never durably committed. If FileJournal::append writes a complete entry but sync_data then fails, persist marks the actor storage-failed and publishes no update — but the ReplicationFeed handler reads the journal without checking that state, and replication_snapshot's newline check accepts the fully written but unconfirmed bytes. A newly connected replica therefore receives a terminal-committed snapshot containing the failed mutation while existing replicas stay at the previous durable cursor; a writer crash can also lose that mutation.

Raised on PR #4589:

No-response evidence

Still live on current main (verified 2026-11-03 via gh api raw reads)

  • pkgs/id/src/world/actor.rs on main, WorldCommand::ReplicationFeed handler (:1577-1591): subscribes and calls journal.replication_snapshot() with no storage_failed check.
  • Same file, persist (:421-425): the append Err branch sets storage_failed = true and returns without publishing ResetFailed (or any update) even when the header version changed.
  • pkgs/id/src/world_store.rs on main (:206-218): replication_snapshot reads the raw file and accepts any newline-terminated bytes as the snapshot.

Acceptance criteria

  • The replication feed refuses (or bounds snapshots to a known-durable boundary) once storage has failed.
  • The append-failure path notifies subscribers (e.g. ResetFailed) when the journal header version changed.
  • A regression test simulates an append whose sync_data fails after a complete write and shows new feeds do not receive the unconfirmed entry.
  • Or: a documented decision on this issue.

Found by the pr-comment-review job from unaddressed PR review comments.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  4. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 3, 2026
  5. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. added a commit that references this issue on Nov 3, 2026
  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · completed

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

    app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-comment-reviewFiled by the pr-comment-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions