Connect Strava

Updated

Linking Strava lets us update bike distances automatically — no manual
odometer entry, and component wear stays accurate without thinking
about it.

How to connect

  1. Go to Settings → Strava.
  2. Click Connect Strava.
  3. You'll be redirected to Strava to authorize the connection.
  4. Grant WatchMy.bike permission to read your activities and gear.
  5. You'll be redirected back and your Strava data starts syncing.

What we read

  • Your Strava gear (so we can match it to your bikes).
  • Activity distances (to update bike mileage).
  • Activity types (so we count only cycling activities).

We never post to Strava or modify your activities. Read access only.

How often it syncs

Two paths run in parallel:

  • Webhook (real-time) — when you save an activity in Strava, a
    webhook fires and we update your bike distances within seconds.
    Same for edits and deletes. Rather than adding or subtracting the
    difference, this path recalculates the bike's totals from every
    activity on record, so a mis-tagged ride that you fix in Strava
    can't leave a permanent error behind.
  • Cron (every 6 hours) — a safety net that catches anything the
    webhook missed, for instance if Strava's delivery failed while a
    deploy was in progress.

You can also hit Sync now in Settings → Strava for an
on-demand refresh, which does the same full recalculation as the
webhook path.

Backfilling historical activities

When you first connect, only new activities flow through the
webhook. To pull in your existing Strava history, go to
Settings → Strava Import and start the import. It runs in the
background — you can close the tab, and the progress bar picks up
where it left off when you come back.

Why it's a background job and not a button that waits

Strava doesn't hand over your history in one response. Its
activities endpoint is paginated, so a rider with 2,000 activities
is ten separate HTTP requests at Strava's maximum of 200 activities
per page — and Strava won't tell us up front how many there are.
Its athlete totals are unreliable enough that we don't trust them,
so the only honest way to find the end of your history is to keep
asking for the next page until one comes back short.

That can't happen inside a single web request. So starting an
import creates a job, drops one message on a queue, and returns
immediately.

What the queue actually does

Each message handles exactly one page. When a page finishes, it
queues the next one — the import walks itself forward rather than
running as one long task. Every new activity found on that page
becomes its own separate message, so fetching from Strava and
writing to your account are decoupled.

This buys four things:

  • Rate-limit safety. Strava allows us roughly 300 read requests
    per 15 minutes and 3,000 per day, shared across everyone using
    WatchMy.bike. We track the usage headers on every response and
    back off at 80% of either ceiling, so a big import slows down
    instead of failing — and instead of spoiling sync for other
    riders.
  • Resumability. Each page records itself as processed. If a
    message is retried, an already-processed page is skipped rather
    than counted twice.
  • Retries. A message that fails is retried up to three times
    before landing in a dead-letter queue, which is where I go
    looking when something's wrong. A transient Strava blip doesn't
    cost you the import.
  • Cancellation. Because the work is queued in pieces, cancelling
    stops it at the current page instead of leaving a half-finished
    long-running task.

If your Strava token expires mid-import, the job refreshes it and
retries the page — you won't notice.

What gets skipped

Non-cycling activities are filtered out, and activities already in
your account are recognised and skipped, so re-running an import
doesn't duplicate anything. Both counts show up in the progress
panel alongside the imported total.

How distance reaches your components

This is the part that makes the import worth doing properly. Each
imported activity is attributed to whatever was installed on that
bike on that date
— not to whatever is on the bike today. A chain
you fitted in March only collects kilometres from rides after March,
and a wheelset you pulled off in June stops collecting them in June.

That's why importing history is more than a number going up: it
reconstructs which parts were on the bike when, so component
mileage is right even for parts you've since swapped.

While the import runs, the totals you see are being added up as
each activity lands, so the numbers move as it progresses. Once
everything has been stored, every bike and component total is
recalculated from scratch against the full activity record — so
if a single update went astray mid-import, the final figure is
still correct rather than quietly short. That recalculation runs
twice, a minute and then five minutes after the last activity, so
it can't race the tail end of a large import.

Only one import can run at a time, and only bikes linked to Strava
gear receive distance — see Linking individual bikes below.

Linking individual bikes

After connecting Strava:

  1. Open a bike's edit page (or visit Bikes → Strava Gear for a
    bulk view).
  2. Pick the matching Strava gear from the dropdown.
  3. Save.

Distances now update automatically based on rides logged with that
gear in Strava.

Token refresh

Strava access tokens are short-lived; we refresh them in the
background using your refresh token. If a refresh fails (e.g. you
revoked access in Strava), we notify you — reconnecting is a
single click.

Do I have to use Strava?

No. Strava is optional. If you don't connect it, just update each
bike's odometer manually whenever you remember. Component wear is
calculated from bike distance regardless of source — works fine with
Garmin, Wahoo, or paper logs.

Related

stravasyncdistanceintegrationoauth

Get your bikes noticed

Track every component and showcase your builds to the world

Already have an account? Login