Skip to content

#015 "Arriving in 4 min" for the rider - #49

Open
Viviiii16 wants to merge 1 commit into
wncc:mainfrom
Viviiii16:issue-015-live-driver-eta-for-rider
Open

Viviiii16 wants to merge 1 commit into
wncc:mainfrom
Viviiii16:issue-015-live-driver-eta-for-rider

Conversation

@Viviiii16

Copy link
Copy Markdown

Closes #15

What changed

  • Backend (GET /rides/{id}/route):** Added approach_duration_s to RouteOut and populated it from ctx.routes.estimate while the driver is on the way (driver_assigned).
  • Backend (driver:location events):** Added throttled road-route ETA calculation (ETA_INTERVAL_S = 15.0) in backend/app/services/locations.py so approach_duration_s is sent to the rider roughly every 15 seconds without recalculating on every raw GPS ping.
  • Rider App (mobile/):** Updated useRideRoute to consume live approach_duration_s updates from driver:location events and updated riderStatusText / RiderRide screen to display "Arriving in N min" and switch to "Driver has arrived" upon arrival.

Testing

  • Extended backend/tests/test_api.py (test_full_ride_lifecycle and test_routes_follow_the_roads) to verify approach_duration_s on GET /rides/{id}/route and 15-second throttling on driver:location.
  • Added unit tests in mobile/src/lib/__tests__/format.test.ts for riderStatusText.
  • Ran python test_all.py --quick and verified with python demo.py.

closes #15

Screenshot 2026-11-01 at 3 40 50 PM Screenshot 2026-11-01 at 3 39 00 PM

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.

"Arriving in 4 min" for the rider

1 participant