Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(contracts): filter unknown timeline members at read boundaries #21491

Closedonly21mil(GitHub profile, opens in a new tab)wants to merge 12 commits intomain fromrefs/pull/21491/headopened View on GitHub

Showing 22 changed files with 18 additions and 7 deletions (loading 19).

x
0 of 22 viewed, 22 left
12 additions and 4 deletionsapps/mobile/scripts/measure-renders.mtsModified
View file
@@ -15,7 +15,9 @@
ProviderInstanceId,
ThreadId,
WsRpcGroup,
+ knownThreadProjection,
type OrchestrationV2ThreadProjection,
+ type ReceivedOrchestrationV2ThreadProjection,
} from "@t3tools/contracts";
import * as Console from "effect/Console";
import * as SecureRandom from "effect/crypto/SecureRandom";
@@ -224,10 +226,14 @@
yield* evaluate(
`__t3RenderCounterOpen(${encodeJson(`${options.scheme}://threads/${environmentId}/${threadId}`)})`,
- const projectionOf = (item: { kind: string; projection?: OrchestrationV2ThreadProjection }) =>
- item.kind === "snapshot" && item.projection
+ const projectionOf = (item: {
+ kind: string;
+ projection?: ReceivedOrchestrationV2ThreadProjection;
+ }) =>
+ (item.kind === "snapshot" && item.projection
? Effect.succeed(item.projection)
- : client["orchestration.getThreadProjection"]({ threadId });
+ : client["orchestration.getThreadProjection"]({ threadId })
+ ).pipe(Effect.map(knownThreadProjection));
const streaming = yield* client["orchestration.subscribeThread"]({ threadId }).pipe(
Stream.mapEffect(projectionOf),
Stream.filter((projection) => streamingItem(projection) !== undefined),