Skip to content

Conversation

@EmmaSimon
Copy link
Contributor

Summary

Ticket: Investigate: nearby stop sort order

The list of stop IDs going into filterStopsWithRedundantPatterns was sorted by distance, but the list coming out gets pieced together from a set and map, which lost the distance context. In most cases this was fine, because another distance sort happens during route card data creation, but in cases like the GL at Hynes, there are multiple bus routes which have a nearest stop at Kenmore. Since the GL Kenmore platforms were also within the radius and the bus routes patterns were being processed first, the GL Kenmore platforms were being returned above Hynes, then the route card processing would assume that was the closest GL stop and filter out Hynes.

This change simply sorts the filtered stop IDs based on the original stop ID list.

iOS
- [ ] If you added any user-facing strings on iOS, are they included in Localizable.xcstrings?
- [ ] Add temporary machine translations, marked "Needs Review"

android
- [ ] All user-facing strings added to strings resource in alphabetical order
- [ ] Expensive calculations are run in withContext(Dispatchers.Default) where possible (ideally in shared code)

Testing

Verified that Hynes now shows up properly when it's the nearest GL stop

@EmmaSimon EmmaSimon requested a review from a team as a code owner July 28, 2025 18:49
@EmmaSimon EmmaSimon requested a review from boringcactus July 28, 2025 18:49
Copy link
Member

@boringcactus boringcactus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad this fix turned out simple.

@EmmaSimon EmmaSimon enabled auto-merge July 28, 2025 18:53
@EmmaSimon EmmaSimon added this pull request to the merge queue Jul 28, 2025
Merged via the queue into main with commit 806b24d Jul 28, 2025
7 checks passed
@EmmaSimon EmmaSimon deleted the es-nearby-sorting branch July 28, 2025 19:32
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.

3 participants