Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore retired and deleted bikes #61

Merged
merged 6 commits into from
Jan 14, 2024
Merged

Ignore retired and deleted bikes #61

merged 6 commits into from
Jan 14, 2024

Conversation

benCoomes
Copy link
Owner

@benCoomes benCoomes commented Jan 14, 2024

What

closes #60

Why

Delete and retired bikes should never be used in a new ride, so ignore them from consideration.

Details

When updating an activity, get the gear details for each gear we are considering and check that it:

  1. Still exists in Strava
  2. Is not retired

Ignore any activities that use missing or retired gear when processing events. We do not make a request for more activities if most (or all) of initially requested activities are filtered out.

This also adds an N+1 request to the strava API - we make a single request for each unique gear ID appearing in recent activities. These requests are made concurrently, so impact on duration should is minimized, but it could consume our API limits more quickly.

AFAIK there is no way to request all the gear details for an athlete, or pass a list of gear IDs.

Commits

  • remove broken lighthouse action
  • add strava api scripts
  • add gear model and client
  • consolidate strava gear, athelete, activity client
  • refactor strava client
  • discard activities with retired gear during classification
  • Handle gear that no longer exists

Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://kind-ocean-0a357fa0f-61.eastus2.azurestaticapps.net

@benCoomes benCoomes marked this pull request as ready for review January 14, 2024 13:25
@benCoomes benCoomes merged commit 918375d into main Jan 14, 2024
3 checks passed
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.

Equipper should never set retired bikes
1 participant