mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 22:50:51 +00:00
release: v1.32.0 — hardening and scalability (#580)
* release: prepare v1.32.0 * test: stabilize water capture re-entry
This commit is contained in:
1 parent
b01822be48
commit
62eb431d66
372 files changed
+25178
-8561
No files matched your search
@@ -110,6 +110,7 @@ export const GET = apiHandler(async () => {
|
||||
where: { userId: user.id },
|
||||
select: {
|
||||
tokenExpiresAt: true,
|
||||
whoopUserId: true,
|
||||
lastSyncedAt: true,
|
||||
createdAt: true,
|
||||
backfillCompletedAt: true,
|
||||
@@ -152,6 +153,7 @@ export const GET = apiHandler(async () => {
|
||||
);
|
||||
|
||||
const now = Date.now();
|
||||
const whoopConnected = !!whoopConn?.whoopUserId;
|
||||
|
||||
return apiSuccess({
|
||||
threshold: getPersistentFailureThreshold(),
|
||||
@@ -196,14 +198,22 @@ export const GET = apiHandler(async () => {
|
||||
configured:
|
||||
!!dbUser?.whoopClientIdEncrypted &&
|
||||
!!dbUser?.whoopClientSecretEncrypted,
|
||||
connected: !!whoopConn,
|
||||
connectedAt: whoopConn?.createdAt?.toISOString() ?? null,
|
||||
legacyLastSyncedAt: whoopConn?.lastSyncedAt?.toISOString() ?? null,
|
||||
tokenExpiresAt: whoopConn?.tokenExpiresAt?.toISOString() ?? null,
|
||||
tokenExpired: whoopConn
|
||||
? whoopConn.tokenExpiresAt.getTime() <= now
|
||||
connected: whoopConnected,
|
||||
connectedAt: whoopConnected
|
||||
? (whoopConn?.createdAt.toISOString() ?? null)
|
||||
: null,
|
||||
legacyLastSyncedAt: whoopConnected
|
||||
? (whoopConn?.lastSyncedAt?.toISOString() ?? null)
|
||||
: null,
|
||||
tokenExpiresAt: whoopConnected
|
||||
? (whoopConn?.tokenExpiresAt.toISOString() ?? null)
|
||||
: null,
|
||||
tokenExpired: whoopConnected
|
||||
? (whoopConn?.tokenExpiresAt.getTime() ?? 0) <= now
|
||||
: null,
|
||||
backfillCompleted: whoopConnected
|
||||
? !!whoopConn?.backfillCompletedAt
|
||||
: null,
|
||||
backfillCompleted: whoopConn ? !!whoopConn.backfillCompletedAt : null,
|
||||
metricFreshness: metricFreshness.whoop ?? [],
|
||||
} satisfies IntegrationViewModel & WhoopExtras,
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user