From 958f8c908ec1fcbbacfe149ec31b0829bc904334 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Jul 2026 09:57:45 +0000 Subject: [PATCH] fix(core): treat empty/whitespace serverTimeUrl as not configured in TimeSyncService --- .../src/lib/auth/services/time-sync.service.spec.ts | 10 ++++++++++ lib/core/src/lib/auth/services/time-sync.service.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/core/src/lib/auth/services/time-sync.service.spec.ts b/lib/core/src/lib/auth/services/time-sync.service.spec.ts index 693da963aa..f2e7ca9b92 100644 --- a/lib/core/src/lib/auth/services/time-sync.service.spec.ts +++ b/lib/core/src/lib/auth/services/time-sync.service.spec.ts @@ -260,6 +260,16 @@ describe('TimeSyncService', () => { httpMock.expectNone('http://fake-server-time-url'); }); + it('should complete silently when serverTimeUrl is whitespace only', () => { + appConfigSpy.get.and.returnValue(' '); + + service.syncClockOffset().subscribe(() => { + expect(service.clockOffsetMs).toBe(0); + }); + + httpMock.expectNone('http://fake-server-time-url'); + }); + it('should leave clockOffsetMs unchanged when the server time endpoint fails', () => { appConfigSpy.get.and.returnValue('http://fake-server-time-url'); service.clockOffsetMs = 5000; diff --git a/lib/core/src/lib/auth/services/time-sync.service.ts b/lib/core/src/lib/auth/services/time-sync.service.ts index cffc854385..cad0e1980f 100644 --- a/lib/core/src/lib/auth/services/time-sync.service.ts +++ b/lib/core/src/lib/auth/services/time-sync.service.ts @@ -249,6 +249,6 @@ export class TimeSyncService { } private getServerTimeUrl(): string { - return this._appConfigService.get('serverTimeUrl', ''); + return this._appConfigService.get('serverTimeUrl', '').trim(); } }