fix(core): treat empty/whitespace serverTimeUrl as not configured in TimeSyncService

This commit is contained in:
copilot-swe-agent[bot]
2026-07-03 09:57:45 +00:00
committed by GitHub
parent aafcf5ce76
commit 958f8c908e
2 changed files with 11 additions and 1 deletions
@@ -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;
@@ -249,6 +249,6 @@ export class TimeSyncService {
}
private getServerTimeUrl(): string {
return this._appConfigService.get('serverTimeUrl', '');
return this._appConfigService.get('serverTimeUrl', '').trim();
}
}