#generalGeneral chat
Viewing the conversation promoted to Preserving unsent editor changes across reconnects← Back to threadJump to latest ↓
N
Has anyone found a safe way to preserve unsent editor changes when Northstar reconnects? Right now a reconnect replaces the local draft with the last server snapshot.
T
Does the overwrite happen as soon as the connection is restored, or only after Northstar receives the first server snapshot?
N
Only after the first server snapshot arrives. The local draft survives the reconnect itself, but the snapshot handler replaces the editor state without checking for unsent changes.
A
We should keep the last synchronized document and the local draft as separate states. After reconnecting, Northstar could apply the new server snapshot as the base and then replay the pending local edits on top of it.
T
That should work if we store unsent changes as operations rather than another complete snapshot. Reconnect would update the base document first, then reapply the local operation log.
N
What happens if one of those operations targets a block that another collaborator deleted while the client was disconnected? That is where we currently lose the draft.
A
If an operation cannot be replayed cleanly, we should preserve its content in a recovery draft and show a conflict instead of discarding it. The user can then copy or reapply the text manually.
T
Agreed. The reconnect contract should be: restore the latest server snapshot, replay compatible local operations, and move any conflicting edits into a recoverable draft. Unsent text must never be silently overwritten. I’ll add a regression test covering both successful replay and the deleted-block conflict.
A
Unrelated: are the new editor keyboard shortcuts documented anywhere? I found the command palette, but not a complete list.
T
Not yet. I’ll add a shortcuts section to the documentation before the next release.
Please log in to chat in #general.