Skip to content

Account: a tombstone cleared in one state dir can come back from the sibling merge #2863

Closed as not planned

Description

@devswha

Follow-up from #2843 (account linking). Not reproduced end to end; found in review.

Where two state dirs share one device registry (server/state-merge.ts), mergeAccountTombstones writes the union of both dirs' account-tombstones.json. A local pairing that clears a key's tombstone in one dir does not clear it in the other, so the next merge brings it back. The start-up repair then keeps the newly paired row (it is newer than the tombstone), but a later signed add for that key is refused as tombstoned.

Expected: a cleared tombstone stays cleared across the merge, for example by recording the clear (key and time) and letting the later of removal and clear win.

Activity

  1. devswha commented on Nov 5, 2026

    @devswha
    OwnerAuthor

    I couldn't reproduce this on the account branch, so I'm closing it as not a bug.

    When two state dirs share one device registry, the merge does bring the other dir's tombstone back. But the merged registry also carries the row paired again in the first dir. At start, the PC drops a tombstone whose key has a row paired after the removal (finishInterruptedWrites in server/devices.ts). So the key stays paired, with no tombstone, whichever dir starts next.

    The refused add from the description can't happen either: an add for a key that already has a row changes nothing.

    The scenario is now a regression test, "a key paired again in one of two state dirs stays paired, without its tombstone, when the other starts", in the PR for #2865.

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions