fix(android): send route_id and start_date; never report the route as trip_id - #101
Open
aaronbrethorst wants to merge 2 commits into
Open
fix(android): send route_id and start_date; never report the route as trip_id#101aaronbrethorst wants to merge 2 commits into
aaronbrethorst wants to merge 2 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second PR in the trip-descriptor stack (stacked on the server PR). The Android driver app used to copy the route id into
trip_idwhenever the driver left the GTFS trip id blank, so the feed published a route id as a trip id. Now:ActiveTripstoresgtfsTripId(blank when the driver only knows the route — never a route id) andstartDate(service date,YYYYMMDD, the device-local calendar date when the trip started, fixed for the life of the trip).route_idandstart_date;trip_idis sent only when a GTFS trip id was entered, and is omitted from the JSON entirely otherwise (explicitNulls = false)."5 "can't publish an unmatchableroute_id.trip_location_idkey is cleaned up on clear.ZoneIdis provided by Hilt so the repository is testable with a fixed zone; tests cover the date-line rollover (23:30 UTC → next day in Nairobi).routeId/startDateand notripIdfor a route-only trip, and adds a final check with a GTFS trip id filled in; the Android design spec's "server-side note" is marked resolved.Requires the server from the previous PR: an older server rejects
route_id/start_dateas unknown fields with 400.Test plan
./gradlew :app:testDebugUnitTest— new/updated:RepositoriesTest(gtfs id + route + Nairobi service date; blank gtfs id stays blank;serviceDateformatting),TrackerApiTest(exact key sets with and withouttrip_id),TripReporterTest(wire body with and without a GTFS id)./gradlew :app:compileDebugAndroidTestKotlindocs/android-smoke-test.md(Check 2 and the final check) against a server running the previous PR