fix(coderd): unarchive child chats with parents (#23761)

Unarchiving a root chat now restores descendant chats in the database
and emits lifecycle events for every affected chat so passive sessions
converge without a full refetch.

This keeps archive and unarchive symmetric at both the data and
watch-stream layers by returning the affected chat family from the
database, using those post-update rows for chatd pubsub fanout, and
covering descendant lifecycle delivery with a watch-level regression
test.

Closes #23666
This commit is contained in:
Ethan
2026-04-01 15:30:25 +11:00
committed by GitHub
parent 1d16ff1ca6
commit 5cba59af79
11 changed files with 383 additions and 55 deletions
+2 -1
View File
@@ -10646,7 +10646,8 @@ func TestChatPinOrderQueries(t *testing.T) {
}
// Archive the middle pin.
require.NoError(t, db.ArchiveChatByID(ctx, second.ID))
_, err := db.ArchiveChatByID(ctx, second.ID)
require.NoError(t, err)
// Archived chat should have pin_order cleared. Remaining
// pins keep their original positions; the next mutation