Skip to content

Fix Strava sync missing delayed activities#54

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-082b
Draft

Fix Strava sync missing delayed activities#54
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/critical-correctness-bugs-082b

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented May 26, 2026

Bug and impact

The Strava sync used the saved lastSync activity start timestamp as the after cursor. If an older ride/run was uploaded after that checkpoint advanced, Strava's activity-list filter excluded it forever, so the local JSON store and workout pages silently missed the activity.

Root cause

after filters by activity start time, but the script treated it like a discovery/sync timestamp. The later checkpoint prevented late-uploaded activities with earlier start dates from being discovered.

Fix

  • Extracted the sync loop into a testable core module.
  • Switched discovery back to full paginated activity listing while still only fetching detail JSON for missing IDs.
  • Added a regression test covering a late-uploaded activity whose start date predates _meta.lastSync.

Validation

  • pnpm vitest run scripts/sync-strava-activities-core.test.mjs
  • pnpm test
  • pnpm build
  • pnpm format
Open in Web View Automation 

Avoid relying on the activity start-time checkpoint for discovery so late uploads with older start dates are still imported.

Co-authored-by: Yu Le <yuler@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

📸 Screenshots for PR #54
page iphone ipad pc
home home iphone home ipad home pc
posts posts iphone posts ipad posts pc
posts-hi posts-hi iphone posts-hi ipad posts-hi pc
thoughts thoughts iphone thoughts ipad thoughts pc
workouts workouts iphone workouts ipad workouts pc
workouts-17883105335 workouts-17883105335 iphone workouts-17883105335 ipad workouts-17883105335 pc

PR screenshots folder (branch pr-screenshots)

github-actions Bot added a commit that referenced this pull request May 26, 2026
EOF && git push -u origin cursor/critical-correctness-bugs-082b

Co-authored-by: Yu Le <yuler@users.noreply.github.com>
github-actions Bot added a commit that referenced this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant