Repository navigation
A Mac re-announces its rows when its hub device changes (D-184) - #135
Merged
Merged
Conversation
…-184) A row's owner on the hub and in the phone's mirror is the device of its latest insert. A Mac whose device changed kept its connections, projects, and threads owned by the old device, so the phone offered a project none of its Mac's connections and could not start a thread there. Mac migration 0010 adds hubLink.ownedAs; HubSync.start re-announces the rows as inserts with the oldest clock when the device changed after something was pushed, which moves ownership on the hub and in the mirror without overriding a phone's edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
blove
enabled auto-merge
November 5, 2026 16:24
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.
The phone couldn't start a thread on the owner's Mac: "No ready connection on your Mac can start a thread in this project." The hub listed the Mac's connections under its earlier device record and the project under the current one, and the phone offers a project only its own Mac's connections (found at the new-thread composer's live gate; the phone-projects gate saw the same for projects).
Cause. A row's owner, on the hub (
owner_device_id) and in the mirror (ownerDeviceId), is the device of its latest insert. When a Mac's device changes (a sign-in that gets a new device), nothing inserts its existing rows again, so they stay owned by the old device.Fix (D-184).
0010_owned_rowsaddshubLink.ownedAs, the device the Mac last announced its rows as.HubSync.startcallsWorkspaceDatabase.claimOwnedRows(): whenownedAsdiffers from the link's device and something was already pushed, it appends aninsertperconnections,projects, andthreadsrow as the current device, and the normal push carries them. With nothing pushed yet (first join, join after leave, fresh account) it only records the device, since the coming upload is the whole log anyway. A link from before the migration re-announces once, which repairs existing installs like the owner's.000000000000-0000-<device>), so the hub and the mirror move ownership and Mac-only columns but never override a clocked column a phone edited. No hub or mirror change.Tests.
OwnedRowsTests(once per device; nothing pushed → record only; pre-migration link → once; link saves don't re-trigger),HubSyncTests.aNewDeviceReannouncesTheRowsItAlreadyPushed(fails with the call removed), andMirrorWritesTests.aReannouncedRowMovesItsOwnerAndKeepsAPhoneEdit.swift test1,406 passed; lint anddocs-index --checkclean.Deploy note. An older Mac build refuses a database migrated to 0010.
🤖 Generated with Claude Code