Merge branch 'fix/v1436-gh' into release/v1.43.6

This commit is contained in:
Marc-André Bombeck committed 2026-10-19 17:26:51 +02:00
commit 9d6bfe2624
30 files changed
+1705 -129

No files matched your search

@@ -3,6 +3,7 @@ import { apiHandler, requireAuth } from "@/lib/api-handler";
import { annotate } from "@/lib/logging/context";
import { apiSuccess } from "@/lib/api-response";
import { loadOneConnectionHealth } from "@/lib/integrations/connection-health-load";
import { googleHealthBackfillEndedList } from "@/lib/google-health/sync-core";
/**
* Get Google Health connection status for the current user (v1.26.0).
@@ -37,6 +38,7 @@ export const GET = apiHandler(async () => {
lastSyncedAt: true,
tokenExpiresAt: true,
backfillCompletedAt: true,
backfillProgress: true,
needsReauth: true,
createdAt: true,
scope: true,
@@ -57,6 +59,7 @@ export const GET = apiHandler(async () => {
tokenExpired,
tokenExpiresAt: connection.tokenExpiresAt,
backfillCompleted: !!connection.backfillCompletedAt,
backfillEnded: googleHealthBackfillEndedList(connection.backfillProgress),
needsReauth: connection.needsReauth,
scope: connection.scope,
// The one server-resolved state (ok / limited / degraded /
+9
View File
@@ -52,6 +52,10 @@ import { getPolarClientCredentials } from "@/lib/polar/credentials";
import { getStravaClientCredentials } from "@/lib/strava/credentials";
import { hasActivityScope } from "@/lib/withings/client";
import { loadConnectionHealth } from "@/lib/integrations/connection-health-load";
import {
googleHealthBackfillEndedList,
type GoogleHealthBackfillEndedEntry,
} from "@/lib/google-health/sync-core";
import type { ConnectionHealth } from "@/lib/integrations/connection-health";
export const dynamic = "force-dynamic";
@@ -156,6 +160,7 @@ export const GET = apiHandler(async () => {
lastSyncedAt: true,
createdAt: true,
backfillCompletedAt: true,
backfillProgress: true,
needsReauth: true,
},
}),
@@ -384,6 +389,9 @@ export const GET = apiHandler(async () => {
backfillCompleted: googleHealthConn
? !!googleHealthConn.backfillCompletedAt
: null,
backfillEnded: googleHealthConn
? googleHealthBackfillEndedList(googleHealthConn.backfillProgress)
: [],
// v1.27.0 — `needsReauth` is the 7-day Testing-mode refresh expiry (or a
// user-revoked grant) surfaced from the connection row; the card reads it
// to raise a distinct "Reconnect" CTA separate from parked/disconnected.
@@ -555,6 +563,7 @@ interface GoogleHealthExtras {
tokenExpiresAt: string | null;
tokenExpired: boolean | null;
backfillCompleted: boolean | null;
backfillEnded: GoogleHealthBackfillEndedEntry[];
needsReauth: boolean;
}