From 8a5ee7bda9ff3fbebd4b1580d6d8c85767115d41 Mon Sep 17 00:00:00 2001 From: mektpoy Date: Tue, 20 Oct 2026 22:47:49 +0800 Subject: [PATCH] fix(liveshare-protocol): keep the forking half of the withdrawn tier Normalizing fork-readonly to view dropped the switch the withdrawn name implied when no allowsFork was present, so a legacy registration silently lost forking. Both parsers now set allowsFork true for that case, matching what the old name granted. --- .../liveshare-protocol/src/tunnel-protocol.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/experimental/liveshare-protocol/src/tunnel-protocol.ts b/packages/experimental/liveshare-protocol/src/tunnel-protocol.ts index b86387f68a..aca8f579eb 100644 --- a/packages/experimental/liveshare-protocol/src/tunnel-protocol.ts +++ b/packages/experimental/liveshare-protocol/src/tunnel-protocol.ts @@ -383,7 +383,13 @@ export function parseTunnelWorkerCommand(value: unknown): TunnelWorkerCommand | ...share, ...(share.sessionMode === undefined ? {} - : { sessionMode: normalizeShareSessionMode(share.sessionMode) }), + : { + sessionMode: normalizeShareSessionMode(share.sessionMode), + // The withdrawn name granted forking; keep that half when the value named no switch. + ...(share.sessionMode === 'fork-readonly' && share.allowsFork === undefined + ? { allowsFork: true } + : {}), + }), }, } } @@ -532,6 +538,7 @@ export function parseShareAccessState(value: unknown): ShareAccessStateFrame | u } return { type: 'share-access-state', version: Number(value.version), accessMode: value.accessMode, allowedSubjectIds: [...value.allowedSubjectIds], sessionMode: normalizeShareSessionMode(value.sessionMode), + ...(value.sessionMode === 'fork-readonly' && value.allowsFork === undefined ? { allowsFork: true } : {}), ...(value.allowsFork === undefined ? {} : { allowsFork: value.allowsFork }), ...(value.expiresAt === undefined ? {} : { expiresAt: value.expiresAt }) } }