(input: {
readonly expiresAt: number | null;
readonly now?: number;
readonly skewMs?: number;
})
| 1648 | * signal. Keep the two paths in sync — narrowing the reactive retry strands |
| 1649 | * every null-expiry connection with no way to recover short of a reconnect. */ |
| 1650 | export const shouldRefreshToken = (input: { |
| 1651 | readonly expiresAt: number | null; |
| 1652 | readonly now?: number; |
| 1653 | readonly skewMs?: number; |
| 1654 | }): boolean => { |
| 1655 | if (input.expiresAt === null) return false; |
| 1656 | const now = input.now ?? Date.now(); |
| 1657 | const skew = input.skewMs ?? OAUTH2_REFRESH_SKEW_MS; |
| 1658 | return input.expiresAt <= now + skew; |
| 1659 | }; |
no outgoing calls
no test coverage detected