Ensure /tracking is backwards compatible#305
Merged
Merged
Conversation
Omarrasheed
approved these changes
Sep 10, 2020
Contributor
Omarrasheed
left a comment
There was a problem hiding this comment.
Lgtm. Let's try to always keep back compat in mind when making these changes. Ik Android has had lots of issues w our naming conventions and types, but these things are not v easy to change.
| }; | ||
| } | ||
| return { | ||
| bearing: vehicleData.bearing, |
Contributor
There was a problem hiding this comment.
These, and all other new fields, can still be added.
| routeID: Number(routeID), // although input is string, old clients expect a number | ||
| runID: 0, | ||
| speed: vehicleData.speed, | ||
| timestamp: vehicleData.timestamp, |
| } | ||
| return { | ||
| bearing: vehicleData.bearing, | ||
| congestionLevel: vehicleData.congestionLevel, |
aliciaxw
approved these changes
Sep 11, 2020
Contributor
aliciaxw
left a comment
There was a problem hiding this comment.
thanks for the documentation!
| * tripID : String | ||
| * },... ] | ||
| * NOTE: Because we need to provide backwards compatibility with old iOS clients | ||
| * we have to follow their janky way of routeID input is String but routeID |
cindy-x-liang
pushed a commit
that referenced
this pull request
Oct 9, 2025
* Add refactor * Add both ways working * Add some comments * Fix more omar requests * Edit more fields * Update old dockerfile
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.
Overview
A !! VERY IMPORTANT !! note to Android & iOS Refactorers:
Last semester, Android requested that I change the POST request field
routeID:stringto berouteNumber:integerbecause that was consistent withv2/route. However, this won't work with old iOS clients, who send inrouteID:stringand expectrouteID:integeras a response. Don't ask me why this isn't consistent, but it looks like Android will just have to deal with this. So, whatever we returnrouteNumber:integerinv2/route, just change the name torouteIDand cast it to a string before putting intov2/tracking. Make sure you expect the response to berouteID:integeras well.Thanks to @Omarrasheed, I've updated the response to include everything that the iOS clients need:
Changes Made
Update /tracking so that old iOS clients still work
Update docker images so we can run locally
Test Coverage
Tested locally works, going to be deploying
Next Steps
Update microservice to include vehicle id and other fields
Related PRs or Issues
#292
#295
Old Request Example - let's try to deprecate this
Request Body

For you to copy and paste: { "data" : [ { "stopID" : "523", "routeID" : "82", "tripIdentifiers" : [ "t6A4-b1D-slC", "t60B-b7-slC" ] }, { "stopID" : "1701", "routeID" : "30", "tripIdentifiers" : [ "t60B-b7-slC" ] } ] }Response Body
backwards_compat.txt
New Request Example
Request Body

For you to copy and paste: { "data": [ { "tripID": "t665-bF-slC", "routeID": "41" }, { "tripID": "t64D-b30-slC", "routeID": "37" } ] }Response Body
same_response_diff_values.txt