Production-ready sync API. Proper error handling and validation, rate limiting, connection resilience, sync conflict resolution beyond last-write-wins. Batch processing improvements for large workout histories.
sync_states table is per-athlete per-source (not per-user single-row)apple_health, garmin, strava, etc.) has its own anchor and sync statuslast_sync_status: 'success', 'partial', 'failed'UNIQUE(athlete_id, source, external_id) constraint prevents duplicate imports from the same provider(athlete_id, start_date ±2min, activity_type, duration ±10%) to detect same activity from different sourcesduplicate_of FK vs junction table vs shared duplicate_group UUID (SYNTHESIS §13)source_priorities table: athlete-configurable provider priority (e.g., Apple Health > Garmin > Strava)See docs/api-research/SYNTHESIS.md §9 (Unit Conventions), §11 (Deduplication & Conflict Resolution).