Skip to content

1.45.2: an update no longer doubles the sessions running on a paired PC - #65

Merged
writingdeveloper merged 1 commit into
mainfrom
fix/update-restore-remote-dupes
Oct 23, 2026
Merged

writingdeveloper merged 1 commit into
mainfrom
fix/update-restore-remote-dupes

Conversation

@writingdeveloper

Copy link
Copy Markdown
Owner

What

After Update all (or any update relaunch), every session on the paired PC came back twice: the running one and a new, empty one under the same name. Each update doubled them — measured on SIHYEONG-4080: alive=7 → 14 (1.45.0 update), alive=15 → 29 (1.45.1 update).

Why

autoRestoreAfterUpdate restored remote tiles too and removed them from the saved list first. Meanwhile the other PC announced its running sessions and syncMachineSessions adopted each as a tile. When a remote entry's turn came, its conversation was already a live tile here, so the theirs check (!live.has(id)) failed and resolveRestoreTarget saw liveIds.has(entry.sessionId) → { sessionId: null, fresh: true } = a new conversation on that PC, same label. Log evidence:

06:41:57 [link] gone SIHYEONG-4080 alive=15
06:41:57 [restore] restore Lumenoir on SIHYEONG-4080: saved=04521d3c -> adopt … (already running there)
06:42:00 [restore] restore 개선 on SIHYEONG-4080: saved=c5a6dee1 onDisk=22 -> fresh (new id)
06:42:02 [restore] restore til-shorts on SIHYEONG-4080: saved=20604c52 onDisk=4 -> fresh (new id)
… (12 more)
06:43:03 [link] gone SIHYEONG-4080 alive=29

Fix

  • takeUpdateRestoreCandidates(pending) → { own, remote }: an update relaunch restores this PC's own tiles only. A remote tile stays saved and comes back by adoption when its PC announces it, keeping tile id, label and pin — the rule takeLaunchRestoreCandidates already applied to plain launches.
  • restoreSession: liveTileHolding(entry) before the remote call and again after the awaits; when found, the entry is consumed (pin carried over) and nothing starts. Logged already open here as <id>; nothing started.
  • liveIds / reserved computed right before resolveRestoreTarget.
  • Unused locale key cockpit.restore_machine_offline_n removed (4 languages).

Tests

  • takeUpdateRestoreCandidates: 2 new tests. Full suite 1530 passed, tsc clean, build OK.

Notes

The duplicates already running on the other PC are not removed by this change — they are indistinguishable from a freshly opened session. Release notes tell the user to Ctrl/Shift-select and close them.

🤖 Generated with Claude Code

https://claude.ai/code/session_016NLGwiBY5uEivJqERQzcoY

After an update relaunch, every session on the other PC came back twice:
the running one (adopted from that PC's announcement) and a new, empty one
under the same name. Measured 7 -> 14 -> 29 sessions on SIHYEONG-4080 across
two consecutive updates.

autoRestoreAfterUpdate restored REMOTE tiles too, and removed them from the
saved list first. While it walked them one by one, the other PC announced its
running sessions and syncMachineSessions adopted each as a tile. When a remote
entry's turn came, its conversation was already a live tile here, so
resolveRestoreTarget read it as "open in another tile" and started a fresh
conversation on that PC - once per saved remote entry, per update.

- takeUpdateRestoreCandidates: an update relaunch restores this PC's own
  tiles only; a remote tile stays saved and comes back by adoption with its
  tile id, label and pin (the rule plain launches already followed).
- restoreSession: when the entry's conversation is already a live tile here,
  the restore is done - nothing is started. Checked before the remote call
  and again after the awaits, where an adoption can land. Logged as
  "already open here as <id>; nothing started".
- liveIds/reserved are computed right before resolveRestoreTarget, not at
  the top of the function.
- Drop the now-unused cockpit.restore_machine_offline_n locale key.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016NLGwiBY5uEivJqERQzcoY
@writingdeveloper
writingdeveloper merged commit 51d92e9 into main Oct 23, 2026
16 checks passed
@writingdeveloper
writingdeveloper deleted the fix/update-restore-remote-dupes branch October 23, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant