Distance capped at 14.49km for long runs in latest.json
Two long run activities show identical distance_km of 14.49 in latest.json despite different actual distances confirmed in Intervals.icu:
- April 12 activity (i148312440): latest.json shows 14.49km / 9.0mi, Intervals.icu shows 21.07km / 13.09mi
- May 10 activity: latest.json shows 14.49km / 9.0mi, terrain_summary also shows 14.8km
All shorter runs show correct distances. The identical value across two different long efforts suggests a hardcoded ceiling, default fallback, or pagination cap in the distance field.
Running sync.py v3.112 on Garmin Forerunner 970, running sport only (no power meter).
looking into it :)
Can you run this in Terminal/PowerShell for both activities? Insert your API_KEY and change the activity ID for May 10. Remember, only paste the result, not your API key :)
Mac/Linux Terminal:
API_KEY="PASTE_API_KEY_HERE"
ACTIVITY_ID="i148312440"
curl -sS -u "API_KEY:$API_KEY" -H "User-Agent: s11-test" "https://intervals.icu/api/v1/athlete/0/activities/$ACTIVITY_ID" | python3 -c 'import sys,json; d=json.load(sys.stdin)[0]; print("athlete activity distance_m =", d.get("distance")); print("athlete activity distance_km =", round(d.get("distance",0)/1000,3))'
curl -sS -u "API_KEY:$API_KEY" -H "User-Agent: s11-test" "https://intervals.icu/api/v1/activity/$ACTIVITY_ID" | python3 -c 'import sys,json; d=json.load(sys.stdin); print("full activity distance_m =", d.get("distance")); print("full activity distance_km =", round(d.get("distance",0)/1000,3))'
Windows PowerShell:
$API_KEY = "PASTE_API_KEY_HERE"
$ACTIVITY_ID = "i148312440"
$a = @(curl.exe -sS -u "API_KEY:$API_KEY" -H "User-Agent: s11-test" "https://intervals.icu/api/v1/athlete/0/activities/$ACTIVITY_ID" | ConvertFrom-Json)
"athlete activity distance_m = $($a[0].distance)"
"athlete activity distance_km = $([math]::Round($a[0].distance / 1000, 3))"
$f = curl.exe -sS -u "API_KEY:$API_KEY" -H "User-Agent: s11-test" "https://intervals.icu/api/v1/activity/$ACTIVITY_ID" | ConvertFrom-Json
"full activity distance_m = $($f.distance)"
"full activity distance_km = $([math]::Round($f.distance / 1000, 3))"
Here are the raw API responses for both activities. April 12 (i148312440): "distance":21068.78, "icu_distance":21068.78 But latest.json shows distance_km: 14.49 May 11 (i148312338): "distance":8066.87, "icu_distance":8066.87 This one shows correctly in latest.json as 8.07km The API is returning correct distances in both distance and icu_distance fields. sync.py appears to be reading a different field and capping at 14490m / 14.49km for longer efforts. May be a pagination issue or wrong field reference on activities above a certain duration threshold.
Also flagging a separate CTL sync issue: The wellness API returns "ctl":29.21307 but latest.json has been writing ctl: 22.74 across multiple scheduled sync runs. Confirmed via direct curl against the wellness endpoint today. The scheduled workflow runs are completing successfully and the API is returning updated values, but the CTL field in latest.json isn't updating to reflect them. This started after a large historical Strava import yesterday which updated the fitness curve in Intervals.icu. The UI shows CTL 30 correctly but the API value of 29.21 is not making it into latest.json despite successful sync runs.
Note: A third activity (May 2) also shows 14.49km in latest.json. Haven't confirmed its actual distance via API yet — can run the same curl if helpful for diagnosis.
Activities show null or missing fields If your device syncs through Strava, the API returns stripped data. Strava's API terms restrict detailed fields when accessed through third-party APIs — Intervals.icu shows everything in the UI, but the API returns empty fields.
Fix: Connect your device (Garmin, Wahoo, etc.) directly to Intervals.icu in Settings → Connections. Keep Strava connected if you want, but the training data needs to come in direct.
Thanks! So my Garmin Forerunner 970 is already connected directly to Intervals.icu. For the CTL sync bug: I imported 186 historical .gpx activities yesterday which caused Intervals.icu to recalculate the full fitness curve. The wellness API now correctly returns ctl:29.21307 but sync.py keeps writing 22.74 across every scheduled sync run since. The UI shows CTL 30 correctly. Is it possible sync.py is reading a cached or stale wellness value rather than the freshly recalculated one? Would deleting the Strava-uploaded activities and forcing a fresh history.json regeneration fix this?
Please delete latest.json and history.json, and run the sync twice. Besides that, do you have anything planned in your intervals.icu calendar? sync.py makes some computation on these values
Deleted both files and ran workflow twice as suggested. Files were recreated fresh (new commit at 2026-05-16 23:04:29) but the content inside latest.json is identical to before - showing last_updated is still 2026-05-15T23:32:06 and ctl is still 22.74. The file is being committed but sync.py appears to be writing stale data on every run regardless of whether the file previously existed?
Also, nothing planned in intervals calendar
Can you check a few setup details?
-
Are you using GitHub Actions auto-sync, local sync, or something else?
-
Is your auto-sync.yml copied from the current Section 11 version?
-
In the GitHub Actions workflow log, what does the sync script version show?
Steps:
• Open the repo that contains latest.json • Click Actions • Open the newest run, usually "Auto-Sync Intervals.icu Data" • Click the job "sync" • Open the step "Run sync" • Find the configuration block and paste: Version: 3.xxx
- In that same Run sync step, do you see either of these lines?
✅ Data published to GitHub
or
⏭️ No changes detected, skipping update
- From the generated latest.json, please paste:
metadata.last_updated metadata.version current_status.fitness current_status.fitness.fitness_source READ_THIS_FIRST.quick_stats
Not using the Intervals calendar should not by itself lower CTL. With no planned workout today, sync.py should use Intervals’ wellness API CTL directly. The suspicious part is that latest.json.metadata.last_updated stayed old after a successful run, so checking whether the workflow is actually publishing fresh sync output or committing stale files.
Thanks for the checklist, here's what I found:
- Using GitHub Actions auto-sync
- Yes, auto-sync.yml is from the current Section 11 repo
- Version: 3.112
In the Run sync step I see: ✅ Data published to GitHub From latest.json: metadata.last_updated: 2026-05-15T23:32:06.964296 metadata.version: 3.112 current_status.fitness.ctl: 22.74 current_status.fitness.atl: 38.23 current_status.fitness.tsb: -15.49 current_status.fitness.fitness_source: "From Intervals.icu API (reflects completed workouts)" READ_THIS_FIRST.quick_stats: total_training_hours: 4.66 total_training_formatted: 4h39m total_activities: 6 total_tss: 280
Additional context: The Intervals.icu wellness API is returning ctl: 29.21 when queried directly via curl. The last_updated timestamp has not changed across multiple successful workflow runs including after deleting both files and regenerating fresh. The file is being committed but the internal data appears frozen at the May 15 23:32 snapshot.
I can’t reproduce this with current sync.py/auto-sync.yml, and no other users are reporting it, so this looks repo/workflow-specific rather than a general Section 11 bug.
Please replace both sync.py and .github/workflows/auto-sync.yml with fresh copies from the official repo, then run the workflow again.
If it still freezes, please paste the full Run sync log, especially:
• the GITHUB_REPO: line • the printed static raw URL • whether it says No changes detected before Data published
The key anomaly is that metadata.last_updated is frozen. In current sync.py, that timestamp is generated during the run, so if it does not change, we need to verify the workflow is publishing to the same repo/file you’re inspecting and not serving/committing an old artifact.
Replaced both sync.py and auto-sync.yml with fresh copies from the official repo and ran the workflow again. Still frozen. Full Run sync log details:
GITHUB_REPO: brandtdixon16-netizen/training-data ✅ Static raw URL: https://raw.githubusercontent.com/brandtdixon16-netizen/training-data/main/latest.json ✅ No No changes detected line appears — goes straight to Data published ✅
Verified the workflow is publishing to the correct repo and file — the static URL in the log matches exactly what we're inspecting.
Additional finding: history.json has script_hash: a60c2ee19b34 and data_range.latest: 2026-05-14. The frozen metadata.last_updated in latest.json is 2026-05-15T23:32:06 — one day after the history data range ends. The Intervals.icu wellness API returns ctl: 29.21 when queried directly but latest.json consistently writes 22.74. Could oldest_display in collect_training_data be anchored to a stale date from history.json rather than datetime.now()?
Root cause: The workflow was running sync.py in GitHub API mode (with --github-token + --github-repo), which pushes fresh data via the API but doesn't write the fresh latest.json to the workflow checkout. The archive step then staged the stale checkout copy and committed it on top, reverting every sync.
Fix: In your auto-sync.yml, replace the sync.py invocation with --output latest.json and remove the --github-token/--github-repo flags. This switches to single-writer mode — sync.py writes to disk, the workflow commits.
The official auto-sync.yml has been updated with this fix. Sorry, this took a while to pin down.