mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
GoogleDriveAdapter refreshed its access token only in memory: the rotated tokens were never written back, so the next launch loaded a stale access token and the user was forced to reconnect. This is the same defect #1208 fixed for OneDrive, which GoogleDriveAdapter never received because it did not expose setOnTokensRefreshed — making the shared attachTokenRefreshPersistence a no-op for Google. Add setOnTokensRefreshed to GoogleDriveAdapter and route both refresh points (setTokens / ensureValidToken) through a refreshTokens helper that stores the rotated tokens in memory and notifies the persistence callback, so attachTokenRefreshPersistence now encrypts and persists them. Google's refresh response usually omits refresh_token (it does not rotate on every refresh), so refreshTokens carries the previous refresh token forward when the response lacks one — otherwise the persisted connection would become unrefreshable. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>