Open chats: the server moves a restarted chat (/new) to its new session

The server-stored open-chat set kept a /new'd chat's old session unless the
restarting device's own write landed, so another device (the phone) came
back to the old conversation. chat_new_session now replaces the session in
the stored set in place (position and floating kept) and pushes the new
revision to every connection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 00:43:33 +00:00
parent fd5d4b783c
commit 4eb9b2e934
5 changed files with 136 additions and 0 deletions
+1
View File
@@ -108,6 +108,7 @@ func handleChatNewSession(ctx context.Context, request protocol.Message, broker
fail("session " + created.ID + " was started but the chat could not move to it: " + err.Error())
return
}
replaceInChatWorkspace(ctx, registry, hub.changes(), oldID, created.ID)
row, found, err := registry.OperatorSession(ctx, created.ID)
if err != nil || !found {
fail("session " + created.ID + " was recorded but could not be read back")