🐛 Fix issues related to checking into international trains #2407
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.
As issue #2401 already mentioned, checking into UK trains does not seem to work. Neither using the old check-in interface nor using the new (experimental) one.
I've never worked on the Träwelling codebase before, so take this with a grain of salt 😅
New check-in interface
To me it looks like the issue with the new interface was due to many UK trains not having a line name provided in the data. Some Vue components were not accounting for that.
![Screenshot 2024-03-10 at 18 49 50](https://private-user-images.githubusercontent.com/36338179/311530063-cc67044f-5ecd-4fad-92c4-46af2b134c22.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI4Mjc5NjksIm5iZiI6MTcyMjgyNzY2OSwicGF0aCI6Ii8zNjMzODE3OS8zMTE1MzAwNjMtY2M2NzA0NGYtNWVjZC00ZmFkLTkyYzQtNDZhZjJiMTM0YzIyLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA1VDAzMTQyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThkY2VkMTYyNTRmYTA3ODkzM2RiYzM0ZjdmNTFjMWIxYTA0YmRlODM2YTk4OTE1ZGZhZDVlN2VkZDViMTM2NzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7Z_gSqAuN6uOuMsAXsUhONh8zH-_wea5ioogt-zCAnI)
I fixed this by checking for empty line names and using the
fahrtNr
as a fallback. This seemed to be the preferred solution looking at the old interface.This actually seems to resolve the display glitches and the 422 errors when trying to check into a train:
Old check-in interface
However, the old interface doesn't seem to have any issues with empty line names. The only problem there is the empty stopovers. As far as I can tell, this issue is related to the filtering of stopovers introduced in #2322.
The UK trains seem to provide the planned departure (
departure_planned
) in their own timezone. Hence, checking against the departure time passed by the front end does not work (as the UK time is one hour behind).I removed the departure time check and only kept the check against the start station passed by the front end. I hope this is sufficient? Not entirely sure on that one though.
Before:
![Screenshot 2024-03-10 at 18 47 15](https://private-user-images.githubusercontent.com/36338179/311529973-e022f678-6274-4e35-a902-81523cb0497e.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI4Mjc5NjksIm5iZiI6MTcyMjgyNzY2OSwicGF0aCI6Ii8zNjMzODE3OS8zMTE1Mjk5NzMtZTAyMmY2NzgtNjI3NC00ZTM1LWE5MDItODE1MjNjYjA0OTdlLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA1VDAzMTQyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWViYjA4YjUzMGIwZjZiMDdmMWY1ZjBmYzNjMDhiZjRiZWY3ODU0ZTRiOGFhYWI5NzNlNTY0YmVhNWIzMDZjMzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.j2Cn53l0XFiYjNW8O5m_z4CQdlnGW9WkO3xt82u7-Nc)
After:
![Screenshot 2024-03-10 at 18 48 04](https://private-user-images.githubusercontent.com/36338179/311529965-bac4eeb8-7dc8-466f-b4e2-d846e0ffe3b4.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI4Mjc5NjksIm5iZiI6MTcyMjgyNzY2OSwicGF0aCI6Ii8zNjMzODE3OS8zMTE1Mjk5NjUtYmFjNGVlYjgtN2RjOC00NjZmLWI0ZTItZDg0NmUwZmZlM2I0LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA1VDAzMTQyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQxYzc3ZGRiNmUwZDU4NDYxNTc2Mzc1N2NmZmU4YjkyYTk4MGEzYjExOGUwNzQ5Zjg2MjY0NzhkZDE1OTRiYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PJvaVwAbQfMb2jOeNWkC1eK6lRoQ4AdU2jmPQZimhnc)
Resolves #2401