diff --git a/lib/ts/utils/dateProvider/defaultImplementation.ts b/lib/ts/utils/dateProvider/defaultImplementation.ts index b0cd0317..648bc317 100644 --- a/lib/ts/utils/dateProvider/defaultImplementation.ts +++ b/lib/ts/utils/dateProvider/defaultImplementation.ts @@ -26,9 +26,16 @@ export class DateProvider { // We took the following considerations into account while designing the cache implementation: // 1. Cache cleared with an active session while the FE clock is wrong (e.g., Safari clears localStorage after 7 days). - // 2. Outdated information in the cache that will make this clock point into the future. - // 3. Other tabs (on different subdomains) refreshing the session while we have outdated info in the cache. - // 4. Other tabs refreshing the session while we have outdated info in memory. + // - Resets clockSkewInMillis to 0, corrected in the next front token update. + // 2. Outdated info in the cache making the clock point into the future. + // - May cause validator.shouldRefresh to always be true, corrected by the next front token update. + // 3. Outdated info in the cache making the clock point into the past. + // - May cause validator.shouldRefresh to always be false, fixed during the next token refresh (worst case). + // 4. Other tabs (on different subdomains) refreshing the session with outdated info in the cache. + // - Each subdomain has its own cache (localStorage), similar implications to cases 2 and 3. + // 5. Other tabs refreshing the session with outdated info in memory. + // - May cause validator.shouldRefresh to always be true or false, fixed in the next front token update. + static init() { if (DateProvider.instance !== undefined) { return;