Repository navigation
fix: keep a previous peer's conversation from a new one - #6
Merged
Merged
Conversation
Catch-up sent every entry above the peer's `have`, and a new peer's is 0, so pairing with someone new after unpairing sent them everything written to the previous one. Pairing with a new key now records shared_after, my highest sequence number at that moment; shares() keeps catch-up and live sending above it, and off messages from before it. Pairing again with the same key keeps the floor, and pairings from before this have none (0), so they carry on as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The UI named every message that wasn't mine after the current peer, so after re-pairing, the previous peer's messages showed the new one's name. A people table (schema 6, filled from the current pairing) keeps everyone this computer has been paired with by their last known name; pairing and name changes keep it current, and unpairing leaves it. Status carries it, and the transcript names each author from it, through a key that only changes when a name does, so rows don't re-render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After unpairing, nothing of the previous peer's stays: no receipts, no version, not after a restart either. Someone new on an older build then gets a Seen of 0, and neither vanishing messages nor files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unpairing keeps the history on this computer, as the unpair dialog says. Two things went wrong when you then paired with someone new.
1. The new peer received everything written to the previous one. Catch-up sends my entries above the peer's
have, and a new peer'shaveis 0.Editing or deleting older messages still works on this computer; those entries just aren't sent. Pairings from before this have no floor (0), so they carry on exactly as before. There's no wire change.
2. The previous peer's messages showed the new peer's name.
nameOfused the current peer's name for every author but me.Evidence
Before (
main): a probe test run againstmain:After:
a_new_peer_gets_only_what_is_written_after_pairingpasses. Carol's log from Alice holds only "hi carol" and its edit. That holds even though Alice edited and deleted her old message to Bob after pairing Carol.The new test fails when catch-up goes back to
since(me, their_have).messages_keep_their_author_s_name_after_pairing_someone_newcoverspeople: Bob's name is kept after pairing Carol, follows his rename, and lasts across a restart.people_from_before_0_8_are_keptmigrates a 0.7 database and keeps its peer's name.a_new_pairing_starts_cleanchecks that unpairing leaves no receipts or version behind, even across a restart. It fails whenunpairstops forgettingpeer_version.only_entries_from_after_pairing_are_sharedunit-testsshares.people.test.tstests the namer and its key.Every commit passes
bun run check,bun run test,cargo fmt --check,clippy -D warningsandcargo teston its own.Merge Danger
Door: one-way, for the schema
Schema 6 adds a
peopletable. An older build opening the database ignores the table, so going back to an older build still works, but the migration itself can't be undone. Everything else is a two-way door.Blast Radius: sync
Catch-up and live sending now pass through
shares. If it were wrong, a current peer would miss entries. The protocol tests for catch-up, replacement, edits and deletes, and reactions all still pass, and existing pairings have a floor of 0, sosharesonly checks targets for them.🤖 Generated with Claude Code