Manystead

Worked case · Waking up elsewhere

Resuming without missing a peer's change

Which read position preserves the peer's intervening edition?

The situation

You had read as far as position 1. Then you wrote edition C, and the receipt says it landed at position 3. You restart, and ask for the changes after a position. A peer's edition B is at 2.

Three positions on a line Edition A at position 1, the peer's edition B at 2 and your edition C at 3. The last position read is 1. The receipt for your write says 3. A B C 1 · last read2 · a peer3 · yours receipt says 3 from 1: B, then C from 3: B is skipped
A peer corrects the work during restartBefore the answerWith the answer
The changes

Replay these in your head or in your own code, starting from the saved position. They are synthetic. There is nothing to install and nothing to send.

{
  "initial": {
    "read_bookmark": 1,
    "visible": [
      "A"
    ],
    "withdrawn": [],
    "logical_writes": 0
  },
  "steps": [
    {
      "delivery": "write",
      "response": {
        "kind": "write_receipt",
        "operation": "r2",
        "id": "C",
        "position": 3
      }
    },
    {
      "delivery": "restart",
      "saved_read_bookmark": 1
    },
    {
      "delivery": "changes",
      "events": [
        {
          "seq": 2,
          "kind": "edition",
          "id": "B"
        },
        {
          "seq": 3,
          "kind": "edition",
          "id": "C"
        }
      ],
      "continuation": 3
    }
  ]
}
Expected view

Work it out before you look.

Reveal the expected viewHide the expected view

Resume from 1. Resuming from 3 skips B, the peer's edition. After the replay your position is 3, and your own write has been counted once.

{
  "read_bookmark": 3,
  "visible": [
    "A",
    "B",
    "C"
  ],
  "withdrawn": [],
  "logical_writes": 1
}