GitHub
10/22/2026, 8:43 PMtoken_expiry_margin (class attribute and constructor argument, default 5 minutes) and treat the token as expired that many seconds early. The margin is capped at half of the token's lifetime so short-lived tokens don't trigger a refresh on every request.
Summary by Sourcery
Refresh OAuth access tokens before their stated expiry to improve reliability for long-running syncs.
New Features:
• Add configurable early refresh for OAuth access tokens through the token_expiry_margin setting, defaulting to five minutes.
Bug Fixes:
• Prevent requests from using OAuth tokens during the final moments of their lifetime, reducing failures caused by clock skew and network latency.
Enhancements:
• Cap the expiry margin at half the token lifetime and clamp negative margins to ensure short-lived tokens remain usable.
Tests:
• Add coverage for default, custom, disabled, capped, and negative token expiry margins.
meltano/sdkGitHub
10/23/2026, 9:09 PM