trails/apps/journal/app/lib/connected-services/providers/wahoo
Ullrich Schäfer c43737526e
fix(journal/wahoo): paginate importOne instead of giving up after page 1
The previous \`importOne\` only fetched page 1 of /v1/workouts and errored
with \"not found on page 1\" if the workout wasn't there — silently
breaking import for any workout older than roughly the most recent 30
entries (per_page default). Webhook-driven imports happen to land on
page 1 by definition, so this only bit on user-initiated catch-up
imports of older workouts.

Now we paginate forward, using the \`total / per_page\` returned by page 1
to compute a stop condition, with a \`MAX_PAGES=100\` ceiling so a
misbehaving API can't loop us. We also stop early on an empty page.

Tests:
- new pagination case (workout on page 2, expect 2 fetch calls)
- new \"not found on any page\" case

Full repo: pnpm typecheck, pnpm lint, pnpm test all green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 12:11:33 +02:00
..
importer.test.ts fix(journal/wahoo): paginate importOne instead of giving up after page 1 2026-05-24 12:11:33 +02:00
importer.ts fix(journal/wahoo): paginate importOne instead of giving up after page 1 2026-05-24 12:11:33 +02:00
manifest.ts Wahoo capability adapters + caller migration (groups 3-5) 2026-05-08 01:25:33 +02:00
pusher.test.ts Wahoo capability adapters + caller migration (groups 3-5) 2026-05-08 01:25:33 +02:00
pusher.ts Wahoo capability adapters + caller migration (groups 3-5) 2026-05-08 01:25:33 +02:00
webhook.test.ts Deepen three architectural seams: FIT consolidation, host election extraction, injectable db 2026-05-10 15:52:31 +02:00
webhook.ts fix(journal): architectural audit omnibus 2026-05-24 10:28:33 +02:00