OAuth Token Expiration Handling for Usage Data #
What: The API usage data fetcher now checks if the OAuth token is expiring before making API calls, gracefully falling back to cached data instead of throwing errors.
Details:
- Previously, the usage data fetch (
VPA()at line 471623) would attempt API calls even with expiring tokens, potentially causing "Failed to load usage data" errors - Now checks if token expires within 5 minutes and returns
nullimmediately if so - Falls back to cached usage data rather than displaying errors during token refresh windows
- Evidence:
VPA()at line 471623-471636 in v2.0.53, new check usingW6()(OAuth token getter at line 163812) andYm()(expiration checker at line 67497)
User impact: Fewer transient error messages when viewing API usage near token expiration times.