refactor(integrations): collapse the remaining duplication and drop a dead column

Derive the recovery source rank from the one priority ladder instead of a second
hand-kept map, re-point the WHOOP and Fitbit HTTP classifiers at the shared
status classifier, and lift the near-identical poll-cohort job handlers onto one
factory. Drop the Polar refresh-token column, which was only ever written null
since Polar tokens do not expire. Behaviour is unchanged across the recovery,
classifier, queue and route suites.
This commit is contained in:
Marc-André Bombeck committed 2026-06-14 21:24:28 +02:00
commit 812b217470
13 files changed
+231 -410

No files matched your search

+1 -2
View File
@@ -94,8 +94,7 @@ export const GET = apiHandler(async (request: NextRequest) => {
where: { id: userId },
data: {
polarAccessTokenEncrypted: encrypt(tokens.access_token),
// Polar issues no refresh token; the column stays null.
polarRefreshTokenEncrypted: null,
// Polar issues no refresh token, so no refresh column is stored.
polarUserIdEncrypted: encrypt(polarUserId),
},
});
-1
View File
@@ -36,7 +36,6 @@ export const POST = apiHandler(async () => {
where: { id: user.id },
data: {
polarAccessTokenEncrypted: null,
polarRefreshTokenEncrypted: null,
polarUserIdEncrypted: null,
},
});