Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: look up nearby stop IDs in global response #107

Merged
merged 4 commits into from
Apr 2, 2024

Conversation

boringcactus
Copy link
Member

@boringcactus boringcactus commented Mar 27, 2024

Summary

Ticket: none

Paired with mbta/mobile_app_backend#106, uses the global response as the source of truth for details about nearby routes and stops, since all that data will be loaded regardless.

Moves the GlobalFetcher.getGlobalData call outside of the map, since multiple pages use that data.

Testing

Manually verified continuing functionality and updated tests to match new behavior.

@boringcactus boringcactus force-pushed the mth-nearby-stops-only branch from 262eea5 to e2f8bd5 Compare March 29, 2024 19:10
@boringcactus boringcactus marked this pull request as ready for review March 29, 2024 19:12
@boringcactus boringcactus requested a review from a team as a code owner March 29, 2024 19:12
@boringcactus boringcactus requested a review from BrandonTR March 29, 2024 19:12
@boringcactus boringcactus marked this pull request as draft March 29, 2024 19:42
@boringcactus boringcactus marked this pull request as ready for review April 1, 2024 15:48
Copy link
Contributor

@BrandonTR BrandonTR left a comment

Choose a reason for hiding this comment

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

One small nitpick, otherwise lgtm

guard let stopOnRoute = stopsById[childStopId] else { return nil }
guard let stop = stopOnRoute.resolveParent(stopsById) else { return nil }
guard let stopOnRoute = stops[childStopId] else { return nil }
guard let stop = stopOnRoute.resolveParent(stops) else { return nil }
Copy link
Contributor

Choose a reason for hiding this comment

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

Could combine these into one guard

@boringcactus boringcactus merged commit bfae2dc into main Apr 2, 2024
5 checks passed
@boringcactus boringcactus deleted the mth-nearby-stops-only branch April 2, 2024 19:02
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.

2 participants