Strava
Advanced
The content of this article is aimed at users who are familiar with our platform and have some technical knowledge.
It probably needs no introduction, but Strava is one of the most popular applications among cyclists to record their activities and share them with their community.
Integration with Strava is done through a Strava application . A Strava application is simply an add-on that any user can authorize to enhance their experience.
When a workshop registers a cyclist on our platform, we create a Strava application authorization request on behalf of the cyclist. Thus, when the cyclist accepts the invitation, they are authorizing us to access information about their bikes and rides. It’s important to note that we are the information manager at all times, not the workshop. This way, if a cyclist decides to leave the platform or revoke access to a workshop, they will not be able to access their information.
Authorization Flow
This is the authorization flow with Strava:
A workshop registers a cyclist
Let’s assume the cyclist doesn’t exist on our platform yet. The workshop creates an account for the cyclist and enters their preferred sports app (in this case, Strava). Next, a link is generated through which the cyclist authorizes us to access their information.
The cyclist is notified
The cyclist receives a notification informing them that their workshop has registered them in sincrona and requests to follow their maintenance.
The cyclist authorizes the application
Once the cyclist follows the instructions in the notification, we create their account on our platform.
In parallel, we create a cyclist-workshop relationship, which will allow the mechanic to see the information about the cyclist’s bikes and contact details.
If they don’t authorize
If the cyclist decides not to authorize, or simply ignores the notification, after a reasonable time we will proceed to delete any trace of their registration.
Access to information
All information from Strava will be managed by sincrona. The workshop will only have access to the cyclist’s bikes and rides information when they have previously authorized access.
If the cyclist denies access to their workshop, or changes workshops, their data will remain on the platform. The only thing that will change is the cyclist-workshop relationship.
Synchronization Process
Below is the process for ingesting information from Strava in the main use cases.
Initial synchronization
This only happens when the cyclist accepts authorization for the first time. Here:
- We map the bikes defined in Strava.
- We collect the rides associated with each bike.
- All rides that took place before a safety period will be assumed confirmed and recorded.
- We update component wear values based on recorded rides.
Real-time synchronization
When a cyclist records a new ride, Strava notifies us, then:
- We obtain the details of the ride and the bike used.
- We save a provisional version of the ride without affecting wear values.
- After a safety period (about 3 days):
- We check for possible modifications to the ride (bike changes).
- We update component wear values.
- We mark the ride as confirmed.
Periodic synchronization
Periodically we check if there are new rides, regardless of whether we save the data in real time. The reason for doing this is to make sure we don’t miss any rides in case Strava hasn’t notified us correctly, or we couldn’t process it at the time due to some temporary failure.
Activity updates or deletion
When a user updates certain fields of an activity or deletes it, Strava notifies us. As we receive these notifications, we update or delete the activity on our platform.