fix(peloton): accept nullable workout fields - #2044
Conversation
Reuse activity summary freshness and cap dirty-key batches so analytics cycles do not expand the entire power backlog. Consume precomputed normalized power during refits.
# Conflicts: # docs/production-incident-baseline.md
Treat partial and runtime failures as failed while allowing intentional no-op results. Fixes DOFEK-SERVER-5D.
Avoid recursive ClickHouse views on the request path and verify the compact-model query against a real database. Fixes DOFEK-SERVER-5C.
- time out provider HTTP requests after two minutes - continue provider deletion one durable batch at a time - align Swarm grace and deploy convergence windows Refs DOFEK-SERVER-4N Refs DOFEK-SERVER-2K
# Conflicts: # docs/production-incident-baseline.md
# Conflicts: # .github/workflows/deploy-web-stack.yml # docs/production-incident-baseline.md
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughPeloton schemas now accept nullable or omitted workout fields and instructor IDs. Workout parsing normalizes null completion and source identifiers to undefined. Client and provider contract tests cover the response shape, and an incident baseline documents the production drift and remediation. ChangesPeloton response drift handling
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoPeloton: accept nullable workout fields and missing instructor IDs
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
|
Storybook previews for This comment updates automatically on each PR push. |
Code Review by Qodo
Context used✅ Compliance rules (platform):
154 rules✅ Skills:
fix-provider, write-tests, cloudflare 1.
|
|
🤖 Review skipped: Repository rate limit exceeded. Free accounts are limited to 2 reviews per 4 hours per repository. Upgrade to a paid plan for unlimited reviews. |
Summary
Fixes DOFEK-SERVER-5E.
Root cause
The runtime response schema modeled several optional Peloton fields as undefined-only and required
end_timeplusride.instructor.id. Peloton returned JSONnullfortitle,end_time,metrics_type,peloton_id, andstrava_id, and omitted the instructor ID, so Zod rejected the whole workout page before parsing.Validation
pnpm --filter @dofek/peloton typecheckThe schema change is limited to observed upstream absence semantics; it adds no fallback request, compatibility route, feature flag, or one-off normalization path.
Summary by cubic
Accepts nullable Peloton workout fields and missing instructor IDs at the client boundary, and normalizes null completion/source IDs during parsing to match production payloads and unblock scheduled syncs. Fixes DOFEK-SERVER-5E.
title,metrics_type,peloton_id, andstrava_idare now nullish;end_timeis nullable;ride.instructor.idis optional.end_time: nullas absent; ignore null/“-1” Strava and Peloton class IDs.Written for commit e86e116. Summary will update on new commits.
Summary by CodeRabbit
Bug Fixes
Tests
Documentation