Skip to content

fix(mobility_features): distanceTraveled was always 0 - #1306

Merged
Zeroupper merged 1 commit into
masterfrom
fix/mobility-distance-traveled
Sep 16, 2026
Merged

Zeroupper merged 1 commit into
masterfrom
fix/mobility-distance-traveled

Conversation

@Zeroupper

Copy link
Copy Markdown
Contributor

_findMoves selected the path between two stops as previous <= t <= previous instead of previous <= t <= current, so every Move had an empty path and distanceTraveled was 0 for every MobilityContext (visible in the committed test/testdata/moves.json - every line has "distance":0.0).

  • window now spans previous -> current
  • when no samples are kept for the move (process restarted, _samples is RAM-only), fall back to Move.fromStops straight-line distance rather than 0
  • _samples cleared with the rest of the day's state

Test: the existing 'path between locations' case now asserts distance > 1 km once a move exists (1.7 km, then 3.2 km); it was silently 0 before.

Bumps to 6.2.1.

@Zeroupper
Zeroupper merged commit df9cfd8 into master Sep 16, 2026
1 check 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.

1 participant