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

fix: Fix issue with non-CR routes showing up in nearby transit for stops that also serve distant CR #116

Merged
merged 4 commits into from
Apr 11, 2024

Conversation

EmmaSimon
Copy link
Contributor

@EmmaSimon EmmaSimon commented Apr 11, 2024

Summary

Ticket: Nearby transit shows non-CR routes between 0.5 and 1 mile away

We separately fetch CR stops with a 1 mile radius, and any other stops with a 0.5 mile radius, but we were also returning all sibling stops of any mode when a stop was in range. This was leading to subway routes being bubbled to the top, even though they were only served at more distant commuter rail stops. This change only returns sibling stops of commuter rail if those siblings are also commuter rail.

⚠️ We had initially implemented this behavior on purpose, we thought that it would be weird to show a CR station at all without also showing the other routes that that station served. It seems like we've decided that we don't actually want that, but we should check in with design.

This was initially done on the frontend in mbta/mobile_app#126

Testing

Fix breaking tests, the existing base integration test already had a case where (shuttle) bus stops were being included, now the test checks explicitly that they're excluded.

@EmmaSimon EmmaSimon requested a review from a team as a code owner April 11, 2024 15:43
@EmmaSimon EmmaSimon requested review from KaylaBrady and removed request for a team April 11, 2024 15:43
Copy link

Coverage of commit 3d6314f

Summary coverage rate:
  lines......: 73.8% (815 of 1104 lines)
  functions..: 70.9% (388 of 547 functions)
  branches...: no data found

Files changed coverage rate:
                                                               |Lines       |Functions  |Branches    
  Filename                                                     |Rate     Num|Rate    Num|Rate     Num
  ===================================================================================================
  lib/mbta_v3_api/stop.ex                                      |97.2%     36|92.9%    14|    -      0
  lib/mobile_app_backend_web/controllers/nearby_controller.ex  | 100%     21|90.0%    10|    -      0
  test/support/factory.ex                                      |80.0%     10|55.0%    20|    -      0

Download coverage report

Copy link

Coverage of commit 5f03f69

Summary coverage rate:
  lines......: 73.8% (815 of 1104 lines)
  functions..: 70.9% (388 of 547 functions)
  branches...: no data found

Files changed coverage rate:
                                                               |Lines       |Functions  |Branches    
  Filename                                                     |Rate     Num|Rate    Num|Rate     Num
  ===================================================================================================
  lib/mbta_v3_api/stop.ex                                      |97.2%     36|92.9%    14|    -      0
  lib/mobile_app_backend_web/controllers/nearby_controller.ex  | 100%     21|90.0%    10|    -      0
  lib/open_trip_planner_client/nearby.ex                       |63.6%     22|71.4%     7|    -      0
  test/support/factory.ex                                      |80.0%     10|55.0%    20|    -      0

Download coverage report

lib/mbta_v3_api/stop.ex Outdated Show resolved Hide resolved
Copy link

Coverage of commit 3394fdb

Summary coverage rate:
  lines......: 73.8% (815 of 1104 lines)
  functions..: 70.9% (388 of 547 functions)
  branches...: no data found

Files changed coverage rate:
                                                               |Lines       |Functions  |Branches    
  Filename                                                     |Rate     Num|Rate    Num|Rate     Num
  ===================================================================================================
  lib/mbta_v3_api/stop.ex                                      |97.2%     36|92.9%    14|    -      0
  lib/mobile_app_backend_web/controllers/nearby_controller.ex  | 100%     21|90.0%    10|    -      0
  lib/open_trip_planner_client/nearby.ex                       |63.6%     22|71.4%     7|    -      0
  test/support/factory.ex                                      |80.0%     10|55.0%    20|    -      0

Download coverage report

@EmmaSimon EmmaSimon merged commit ede9fd6 into main Apr 11, 2024
4 checks passed
@EmmaSimon EmmaSimon deleted the es-fix-nearby-mode-distances branch April 11, 2024 19:58
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