Repository navigation
Conversation
The repair of a second Personal left out a pin of the copy when the first space had a pin at the same current address, and the copy's delete then took it from every device. Two pins saved at different pages can be on the same page now, a sign-in page both sent to, and are still two: the second went with its saved address (home), which only the Mac writes. A pin is now the same pin by where it was saved: the record's home, else the page it is on, when the repair and a first join fold the starting space into the first.
A split view is a pair record under its tabs' space. Moving a tab to another space wrote its own record only, so a pair whose tabs both moved still named the old space: no row showed it, and that space's delete took it. The join repair moves a second Personal's tabs into the first space and deletes the copy, so a Mac lost the split views it had there. A move now carries the tab's pairs once both tabs are in the new space, for every move between spaces, not only the repair's.
[Medium impact] The changes affect pin merging and split-view syncing within shared browser spaces. The split-view fix needs to handle separate deliveries to a live Mac before merging. Findings
SummaryThe PR compares pins by their saved address and moves split-view records once both tabs reach another space.
Reviews (1) · Last reviewed commit: "fix: a Mac's split view moves with its t..." · Reviewed by Greptile |
| fields["order"] = Value(tab.order) | ||
| try write(SyncCollection.tab, id, fields) | ||
| emit(.local, [.tab(tab)]) | ||
| let pairs = target == from ? [] : try carryPairs(of: id, from: from, to: target) |
There was a problem hiding this comment.
Split views can still disappear
When the repair reaches a live Mac in separate deliveries, write can send the first tab move before the second tab and the pair's new parent. The Mac saves the old row without the pair. Before taking the next delivery, SyncCenter.receive compares that saved row with its journal and deletes the missing pair. Pair removals always win, so the later carryPairs write cannot restore the split.
Preserve pairs across partial moves on the receiving side, and test separate deliveries through the real Mac row path.
Knowledge Base Used:
What changes
Two fixes to the duplicate-Personal repair from #1106, found by Greptile after it merged:
Why it happened
urlmatched. Two pins saved at different addresses can both sit on the same page, such as a sign-in page. The copy's pin was dropped, and deleting the copy then removed its record from every device. A pin is now the same pin only when its saved address (home) matches, falling back to the current page whenhomeis missing.PhoneSync.movewrote each tab's own record and left the pair under the old space. Deleting the old space then deleted the pair. A move now carries a pair to the new space once both of its tabs are there. This applies to every move between spaces, not only the repair's, because the cause is inmove.Proof
SyncBridgeTeststhat fail onmainand pass here:Checked on
Checklist
SyncBridgeTestspass on iPad and iPhone. Two join tests fail only when run after other suites, and they fail the same way onmain../design-check --base origin/mainandscripts/swift-parse-check --base origin/mainare clean.