mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-01 10:33:14 +08:00
Summary: Previously, we would only refresh Google OAuth2 access tokens at the beginning of the sync loop, and _only_ if the access token had already expired. This meant that if an access token expired in the middle of a sync loop iteration, the user would get prompted with the reauth red box for their account and would have to either go through the oauth flow again or restart the app for sync to continue. This diff makes two changes: 1. Adds 5min of padding to the refresh window, so if a token will expire in <5min, we'll go ahead and refresh the token. This will reduce the possibility that an access token can expire during a sync loop iteration. 2. Catches Invalid Credentials IMAPAuthenticationErrors for Gmail accounts and forces a token refresh on the next sync loop. These should prevent a user from _ever_ having to reauth their Gmail account unless the refresh token is revoked, or we encounter some other permanent error trying to refresh the token. Fixes T7775 (at least some cases) Test Plan: manual Reviewers: khamidou, evan, juan Reviewed By: juan Maniphest Tasks: T7775, T7755 Differential Revision: https://phab.nylas.com/D3908 |
||
---|---|---|
.. | ||
isomorphic-core | ||
local-private | ||
local-sync |