Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): visiting a thread records only its read state #34909

Closedjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/34909/headopened View on GitHub

Showing 6 changed files with 32 additions and 7 deletions (loading 3).

x
0 of 6 viewed, 6 left
4 additions and 5 deletionsapps/server/src/orchestration-v2/Orchestrator.tsModified
View file
@@ -3513,19 +3513,18 @@
command.searchQuery,
: null;
- // Viewing a thread changes read state only. Loading its transcript (or
- // bumping updatedAt) makes a routine read receipt scale with its history.
+ // Viewing a thread changes read state only. Loading its transcript, bumping
+ // updatedAt, or copying the thread into the event makes a read receipt scale with it.
yield* emit(
events,
command,
- type: "thread.visited",
+ type: "thread.visit-recorded",
threadId: command.threadId,
providerInstanceId: thread.providerInstanceId,
occurredAt,
payload: {
- ...thread,
- ...(movesForward ? { lastVisitedAt: visitedAt.value } : {}),
+ lastVisitedAt: movesForward ? visitedAt.value : thread.lastVisitedAt,
...(opens ? { opens } : {}),
16 additions and 1 deletionapps/server/src/orchestration-v2/ProjectionStore.tsModified
View file
@@ -1,5 +1,5 @@
import type { ProjectThreadAwarenessV2Input } from "@t3tools/shared/agentAwareness";
-import { pendingGuestMessageCount } from "@t3tools/contracts";