Engineering
Why connections stop working — and how automatic refresh prevents it
Access tokens expire, refresh tokens get revoked, and provider apps change. Here is what happens behind a connection that just keeps working.
Engineering, SellerPort MCP · · 6 min read
OAuth providers issue two kinds of credentials: a short-lived access token used on each API call, and a longer-lived refresh token used to get new access tokens. Most “it worked yesterday” failures come from the gap between them.
Refreshing before expiry, not after
A background job checks every few minutes for access tokens that will expire soon and renews them ahead of time. A question asked at 2 a.m. finds a valid token waiting, instead of failing on the first call and retrying.
When a provider says no
Refresh tokens can be revoked: a password change, a removed app authorization, or a provider policy. When that happens the connection is marked as needing reconnection, and the assistant is told plainly rather than receiving stale numbers.
- Reconnect from the data source page; the account keeps its history.
- Other connections in the workspace are unaffected.
- Verifying a connection re-runs discovery and refreshes the token on demand.