Skip to content

Commit

Permalink
PR changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anku255 committed Jan 18, 2024
1 parent db1c9b0 commit f27c765
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/ts/utils/dateProvider/defaultImplementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f27c765

Please sign in to comment.