mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
fix(strava): clear the backfill markers when the connection is removed
Disconnecting Strava, or deleting its credentials, cleared the tokens and the athlete but kept stravaBackfillCompletedAt and stravaBackfillResumeBefore. A later connection inherited them: a completed marker kept its history from being read, and a resume point started its first walk below the previous account's oldest activity. Both paths now clear one shared set of columns.
This commit is contained in:
1 parent
742705eadd
commit
bd00845be3
5 files changed
+95
-13
No files matched your search
@@ -70,6 +70,22 @@ export async function clearStravaClientCredentials(
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* The `User` columns a removed Strava connection leaves behind: no tokens, no
|
||||
* athlete, and no backfill state. The backfill markers belong to the account
|
||||
* that was connected. Left standing, a later connection inherited them: a
|
||||
* completed marker kept its history from ever being read, and a resume point
|
||||
* made its first run start below the old account's oldest activity, so
|
||||
* everything newer was never asked for.
|
||||
*/
|
||||
export const STRAVA_DISCONNECTED = {
|
||||
stravaAccessTokenEncrypted: null,
|
||||
stravaRefreshTokenEncrypted: null,
|
||||
stravaAthleteId: null,
|
||||
stravaBackfillCompletedAt: null,
|
||||
stravaBackfillResumeBefore: null,
|
||||
} as const;
|
||||
|
||||
export interface StravaConnection {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
|
||||
Reference in new issue
Block a user