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

UI: Refine leg filtering and add debug logging in TripResponseMapper #261

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Oct 26, 2024

TL;DR

If the first leg is a walking leg, then it does not have any stop sequence and especially for Metro and Train. In those cases the walking leg was getting filtered out from val legs = journey.getFilteredValidLegs() and not getting mapped ot Model in private fun TripResponse.Leg.toUiModel().

Since only Public Transport legs have stopSequence it can be safely removed from the filter logic.

What changed?

  • Modified getFilteredValidLegs() function to only filter legs based on transportation, removing the check for stopSequence.
  • Added detailed debug logging in the toUiModel() function to provide more information about each leg during the mapping process.

Why make this change?

This change aims to improve the accuracy of leg filtering and provide better debugging capabilities. By removing the stopSequence check, we ensure that valid legs with transportation information are not accidentally filtered out. The added logging will help in troubleshooting and understanding the leg mapping process more effectively.

Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ksharma-xyz and the rest of your teammates on Graphite Graphite

@ksharma-xyz ksharma-xyz marked this pull request as ready for review October 26, 2024 13:37
@ksharma-xyz ksharma-xyz force-pushed the 10-27-for_walkingleg_the_stopsequence_will_always_be_null_therefore_it_should_not_fileter_the_valid_legs branch from 32f5831 to db2f12f Compare October 26, 2024 13:39
@ksharma-xyz ksharma-xyz force-pushed the 10-27-for_walkingleg_the_stopsequence_will_always_be_null_therefore_it_should_not_fileter_the_valid_legs branch from db2f12f to 62b93a1 Compare October 26, 2024 13:39
@ksharma-xyz ksharma-xyz changed the title For walkingleg, the stopsequence will always be null, therefore it should not fileter the valid legs. UI: Refine leg filtering and add debug logging in TripResponseMapper Oct 26, 2024
@ksharma-xyz ksharma-xyz added the improvement To improve the current code quality label Oct 26, 2024 — with Graphite App
@ksharma-xyz ksharma-xyz enabled auto-merge (squash) October 26, 2024 13:43
@ksharma-xyz ksharma-xyz merged commit a112928 into main Oct 26, 2024
3 checks passed
@ksharma-xyz ksharma-xyz deleted the 10-27-for_walkingleg_the_stopsequence_will_always_be_null_therefore_it_should_not_fileter_the_valid_legs branch October 26, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement To improve the current code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant