(input: {
readonly expiresAt: number | null;
readonly now?: number;
readonly skewMs?: number;
})
| 1375 | * signal. Keep the two paths in sync — narrowing the reactive retry strands |
| 1376 | * every null-expiry connection with no way to recover short of a reconnect. */ |
| 1377 | export const shouldRefreshToken = (input: { |
| 1378 | readonly expiresAt: number | null; |
| 1379 | readonly now?: number; |
| 1380 | readonly skewMs?: number; |
| 1381 | }): boolean => { |
| 1382 | if (input.expiresAt === null) return false; |
| 1383 | const now = input.now ?? Date.now(); |
| 1384 | const skew = input.skewMs ?? OAUTH2_REFRESH_SKEW_MS; |
| 1385 | return input.expiresAt <= now + skew; |
| 1386 | }; |
no outgoing calls
no test coverage detected