Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/server/src/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6398,7 +6398,10 @@ it.layer(NodeServices.layer)("server router seam", (it) => {
projectionSnapshotQuery: {
getThreadDetailSnapshot: () =>
Effect.gen(function* () {
yield* Effect.sleep("25 millis");
// Publish during the snapshot load, with no sleep. Effect 4
// schedules forkScoped work on a later tick unless
// startImmediately is set, so a delay here would hide a lost
// event.
yield* PubSub.publish(liveEvents, messageEvent);
return Option.some({ snapshotSequence: 1, thread });
}),
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,7 @@ const makeWsRpcLayer = (
const liveBuffer = yield* Queue.unbounded<OrchestrationThreadStreamItem>();
yield* Effect.forkScoped(
liveStream.pipe(Stream.runForEach((item) => Queue.offer(liveBuffer, item))),
{ startImmediately: true },
);
const bufferedLiveStream = Stream.fromQueue(liveBuffer);

Expand Down
Loading