There is an issue with the refresh of the unified authorization credential on the Anna platform

Hi Anna Team:

I just authorized my email this morning, and when I clicked the refresh button in the afternoon, this error popped up.

Token refresh failed: Token 刷新失败: HTTP 400 from https://oauth2.googleapis.com/token — invalid_grant: Token has been expired or revoked.

Even under testing status, the refresh token is valid for 7 days. Logically, the refresh token for an email I just authorized today shouldn’t have expired.

After I deleted the original authorization and re-authorized, this problem went away.

This appears to be an intermittent issue with the Anna platform’s permission authorization — the Anna team may need to check the Anna platform’s code.

Hi @zhaopy2121! :waving_hand:

Thanks so much for the detailed report and the screenshot — this was super helpful in tracking things down! :folded_hands:

Good news: we’ve shipped a fix! :tada:

You actually ran into two separate things:

1. The invalid_grant itself — this error comes directly from Google, and it usually means the refresh token was revoked on Google’s side (e.g., a password change, removing the app’s access in Google security settings, or Google’s own security checks). Unfortunately this can happen even shortly after authorizing, and it’s outside what the platform can prevent. :sweat_smile:

2. A real bug on our side — and this is the part we fixed! Previously, once a credential hit a refresh failure, the Refresh button would replay the cached historical error instead of actually contacting Google again, and the credential could get stuck in a failed state with no way to recover — which is exactly why deleting and re-authorizing was the only workaround. Not great! :bug:

What’s changed: :sparkles:

  • :counterclockwise_arrows_button: Clicking Refresh now always performs a real-time refresh against the provider — you’ll see the live result, not a stale error
  • :flexed_biceps: Transient failures (network hiccups, provider 5xx) no longer permanently brick a credential — it auto-recovers on the next successful refresh
  • :repeat_button: If the refresh token is genuinely revoked (invalid_grant), the credential is clearly marked as expired and you’ll see a Reconnect button to re-authorize in one click — no more delete-and-re-add!

The fix is already live, so you should be all set. If you ever see invalid_grant again right after authorizing, it’s worth checking whether anything changed on the Google account side (password change, app access removal, etc.).

Thanks again for helping us make Anna better — reports like this are gold! :yellow_heart: Happy building! :rocket: