mirror of
https://github.com/narrrl/proton-sdk-rs.git
synced 2026-11-03 16:41:26 +01:00
Proton refresh tokens are single-use. refresh_access_token ran inside the caller's future, so a timeout around the request could drop it after Proton rotated the tokens but before the client stored them, and the session was gone. It now runs on its own task: the tokens are stored and the callback fired whether or not anyone still waits. auth/v4/refresh went through send_retrying, which repeats on timeouts, 408, 429 and 5xx. Any of those may come after the server rotated, and the retry then spends the old token again and gets InvalidRefreshToken. The refresh is now retried only when the connection failed.