From f42d9653c18955cf4c394ea2b019878e49a80de7 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Wed, 29 Jul 2026 00:56:50 +0800 Subject: [PATCH] Merge origin/master (session ISession face) and adapt the goal ref read The runtime's new outward session contract exposes projections as a ProjectionsFace (faceOf only); the ui-goal verb closure reads the current value through faceOf('goal').getSnapshot() instead of the store-level get. Catalogs regenerated after the merge. --- packages/client/ui-goal/src/client/index.ts | 3 ++- packages/client/ui-goal/tests/browser-plugin.spec.tsx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/client/ui-goal/src/client/index.ts b/packages/client/ui-goal/src/client/index.ts index ccca53bf0a..9c9d3f298d 100644 --- a/packages/client/ui-goal/src/client/index.ts +++ b/packages/client/ui-goal/src/client/index.ts @@ -45,7 +45,8 @@ export function apply(ctx: ClientContext): void { /** The session's current projected CAS ref, read at verb call time (no staleness fence: the RPC's CAS is the guard). */ const refOf = (sessionId: SessionId): GoalRef | undefined => { - const projection = sessions.binding(sessionId)?.session.projections.get('goal') as GoalProjection | null | undefined + const face = sessions.binding(sessionId)?.session.projections.faceOf('goal') + const projection = face?.getSnapshot() as GoalProjection | null | undefined if (projection == null) return undefined return { id: projection.goal.id, revision: projection.goal.revision } } diff --git a/packages/client/ui-goal/tests/browser-plugin.spec.tsx b/packages/client/ui-goal/tests/browser-plugin.spec.tsx index a170e542ca..e1eae47529 100644 --- a/packages/client/ui-goal/tests/browser-plugin.spec.tsx +++ b/packages/client/ui-goal/tests/browser-plugin.spec.tsx @@ -71,7 +71,10 @@ function bench(options: { projection?: GoalProjection | null | undefined; failWi ctx.provide('sessions', { binding: (id: SessionId) => ({ sessionId: id, - session: { projections: { get: (key: string) => (key === 'goal' ? options.projection : undefined) } }, + session: { projections: { faceOf: (key: string) => ({ + getSnapshot: () => (key === 'goal' ? options.projection : undefined), + subscribe: () => () => {}, + }) } }, ctx, }), })