Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): threads settle as soon as a client sees their PR merge #16761

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/16761/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 4 changed files with 110 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
47 additions and 0 deletionsapps/server/src/orchestration-v2/PullRequestSyncReactor.test.tsModified
View file
@@ -15,6 +15,7 @@
type PullRequestRef,
type PullRequestStack,
type PullRequestSummary,
+ type ThreadPullRequestKey,
type ThreadPullRequestLink,
type ThreadPullRequestSnapshot,
} from "@t3tools/contracts";
@@ -181,6 +182,7 @@
const summaryCalls = yield* Ref.make<ReadonlyArray<PullRequestRef>>([]);
const stackCalls = yield* Ref.make<ReadonlyArray<PullRequestRef>>([]);
const domainEvents = yield* Queue.unbounded<OrchestrationV2DomainEvent>();
+ const stateChanges = yield* Queue.unbounded<ThreadPullRequestKey>();
​
const summary: PullRequestService.PullRequestService["Service"]["summary"] = (
input,
@@ -218,6 +220,7 @@
summary,
stack,
invalidate: options.invalidate ?? (() => Effect.void),
+ subscribeStateChanges: Effect.succeed(Stream.fromQueue(stateChanges)),
}),
Layer.mock(ProjectionStore.ProjectionStoreV2)({
// Mirrors the store's filter: active threads that have at least one link.
@@ -269,6 +272,7 @@
summaryCalls,
stackCalls,