From 0f0cd323c47df78755832d5cfddb4e90fb8816fb Mon Sep 17 00:00:00 2001 From: Turtle Date: Sat, 14 Nov 2026 15:07:26 +0800 Subject: [PATCH] test(liveshare): derive owner credential horizons from the real clock The spec hardcoded a live horizon of 2026-11-14, which the host compares with Date.now(), so it failed from that date on. Fixes #8465 (cherry picked from commit 252959b3cd8e33c5691c85980cdc7bf305cc0a4b) --- .../liveshare/tests/owner-credential-horizon.host.spec.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/experimental/liveshare/tests/owner-credential-horizon.host.spec.ts b/packages/experimental/liveshare/tests/owner-credential-horizon.host.spec.ts index 754ae962af..fe58fe9109 100644 --- a/packages/experimental/liveshare/tests/owner-credential-horizon.host.spec.ts +++ b/packages/experimental/liveshare/tests/owner-credential-horizon.host.spec.ts @@ -17,9 +17,10 @@ import { describe, expect, it, onTestFinished } from 'vitest' import type {} from '../src/index.ts' import { apply } from '../src/host/share-host.ts' -const START = Date.parse('2026-10-15T00:00:00.000Z') -const PAST = new Date(START).toISOString() -const LIVE = new Date(START + 30 * 24 * 60 * 60_000).toISOString() +// The host compares horizons with the real clock, so both instants are relative to it. +const DAY = 24 * 60 * 60_000 +const PAST = new Date(Date.now() - DAY).toISOString() +const LIVE = new Date(Date.now() + 30 * DAY).toISOString() const STORED_TOKEN = 'stored-payload.stored-signature' /**