acoustic-carpenter-78188
06/20/2026, 11:22 PMKeyringStore.store() overwrites in place, so the delete() is redundant — and harmful: a transient refresh failure (a network blip, an IdP hiccup) wipes the last-good tokens, including a still-valid refresh_token, forcing the user through an unnecessary browser re-login.
What changes were proposed in this pull request?
Drop the premature KeyringStore.delete(self._endpoint) from the refresh-failure paths in the PKCE, device-code, and GCP identity-aware-proxy authenticators. Each fall-through still calls store(), so a successful re-auth persists. At the device-flow poll site the surrounding try/except existed only to delete-and-re-raise, so it's removed and exceptions propagate unchanged.
How was this patch tested?
Added test_pkce_refresh_failure_keeps_cached_credentials and tightened test_device_flow_authenticator, both asserting delete isn't called when a refresh fails. Reverting the fix makes both fail with Expected 'delete' to not have been called. Called 1 times.
Check all the applicable boxes
• I updated the documentation accordingly.
• All new and existing tests passed.
• All commits are signed-off.
flyteorg/flytekitacoustic-carpenter-78188
07/01/2026, 2:52 AM