summaryrefslogtreecommitdiff
path: root/migrations/035_oauth_token_errors.sql
blob: c0100c0aa29a76af058f9c5d3a9d43f41eb359e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- Record why an OAuth token stopped working.
--
-- A stored token row was treated as "connected", full stop. When the refresh
-- token itself goes bad — Google answers invalid_grant, which happens when it
-- is revoked, superseded, or (for an OAuth client still in Testing publishing
-- status) simply older than seven days — settings still showed Google Tasks as
-- connected while every fetch failed in the background.
--
-- Persisting the failure lets settings say "reconnect" instead of "connected",
-- which is the difference between a five-second fix and not knowing anything
-- is wrong. Cleared on the next successful refresh.

ALTER TABLE oauth_tokens ADD COLUMN last_error TEXT;
ALTER TABLE oauth_tokens ADD COLUMN last_error_at DATETIME;