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

Switzerland: SBB Not work. #768

Closed
Mannshoch opened this issue Jul 24, 2021 · 26 comments · Fixed by #888
Closed

Switzerland: SBB Not work. #768

Mannshoch opened this issue Jul 24, 2021 · 26 comments · Fixed by #888
Labels
bug 🐞 A functional defect or unexpected behavior. coverage 🗺️ This is related to the geographic areas supported. upstream 🏞️ Related to an upstream issue.

Comments

@Mannshoch
Copy link

Describe the bug
If I use SBB as provider Transportr do not react on entry any citys.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Routeplaning
  2. Enter a city
  3. Nothing happend

Expected behavior
Dropdown wit trainstations in Zürich appearr.

Versions (please complete the following information):

  • Transportr Version: 2.1.2
  • Device: Samsung S7
  • Android Version: Lineageos 18

SBB API:
https://data.sbb.ch/api/v2/console
https://data.sbb.ch/api/v1/console

@Mannshoch Mannshoch added the bug 🐞 A functional defect or unexpected behavior. label Jul 24, 2021
@ialokim ialokim added coverage 🗺️ This is related to the geographic areas supported. upstream 🏞️ Related to an upstream issue. labels Jul 24, 2021
@ialokim
Copy link
Collaborator

ialokim commented Jul 24, 2021

Thanks for your report, I was able to reproduce the problem. Most probably, SBB changed something on their end so that PTE (the library Transportr uses under the hodd) is unable to access the information. You might consider opening a bug report over there as well.

@sirtoobii
Copy link

sirtoobii commented Aug 12, 2021

Hej @Mannshoch (and others) I've implemented timetable.search.ch as a SBB replacement. Are you interested to participate in a beta-test? If yes, please message me at tobias[dot]bossert[at]fastpath[dot]ch, I will then send you an apk of Transportr with the new Provider included

@sirtoobii
Copy link

Hej testers! Thank you for your feedback. A new release is available with the following fixes:

  • We recognize more transportation types now
  • The nearby stations feature should work now
  • The stationboard-feature should work for every station now
  • No more "null" lines

You can download the new beta (unofficial!) release here: https://sun.fastpath.ch/index.php/s/PLs3xc8j7nzGm4i

@iGormilhit
Copy link

@sirtoobii I tried your unofficial beta, and it works like a charm. Thanks.

@grote
Copy link
Owner

grote commented Nov 15, 2021

Note that PTE upstream has SBB removed. If you want it back in Transportr, one would need to reach out to PTE for the reasons and depending on the answer add it back to the PTE staging fork Transportr is using.

@sirtoobii
Copy link

The reason was the shutdown of SBB's hafas endpoint (schildbach/public-transport-enabler#381). A merge of schildbach/public-transport-enabler#383 would resolve the issue.

@grote
Copy link
Owner

grote commented Nov 15, 2021

Cool, then you could consider submitting it to https://gitlab.com/opentransitmap/public-transport-enabler/ to get it into Transportr quicker.

@sirtoobii
Copy link

@julianfairfax
Copy link

Cool, then you could consider submitting it to https://gitlab.com/opentransitmap/public-transport-enabler/ to get it into Transportr quicker.

This seems to be the same source GNOME Maps uses, which is https://transport.opendata.ch/. By all means that should be merged then as it works fine with GNOME Maps.

@julianfairfax
Copy link

I know there's probably nothing you can do here, but I commented on the linked merge request again, because it should be merged. I hope once it is we'll get support here too

@julianfairfax
Copy link

Cool, then you could consider submitting it to https://gitlab.com/opentransitmap/public-transport-enabler/ to get it into Transportr quicker.

https://gitlab.com/opentransitmap/public-transport-enabler/-/merge_requests/7 has been merged. Does this mean we can get this into Transportr now?

@ialokim
Copy link
Collaborator

ialokim commented Jul 17, 2022

Yes, I'm currently looking into it. Is it a real SBB replacement in the sense that we could keep the old strings and logo or do we need to change them? If yes, please feel free to suggest something. Also: Is it covering whole Switzerland or only parts of it?

@julianfairfax
Copy link

Yes, I'm currently looking into it. Is it a real SBB replacement in the sense that we could keep the old strings and logo or do we need to change them? If yes, please feel free to suggest something. Also: Is it covering whole Switzerland or only parts of it?

I would say yes. I don't fully know that that, but it's what GNOME Maps uses and I'm pretty sure it works fine.

@sirtoobii
Copy link

Yes, I'm currently looking into it. Is it a real SBB replacement in the sense that we could keep the old strings and logo or do we need to change them? If yes, please feel free to suggest something. Also: Is it covering whole Switzerland or only parts of it?

I would say yes. I don't fully know that that, but it's what GNOME Maps uses and I'm pretty sure it works fine.

Yes, this covers whole Switzerland. Regarding the logo and strings: I think its best if we keep the SBB logo (to avoid user confusion) but maybe use "search.ch" as name. Moreover, I found nothing in this regard in their ToS

@Mannshoch
Copy link
Author

The current implementation is able to cover all public transports in switzerland.

@julianfairfax
Copy link

Yes, I'm currently looking into it. Is it a real SBB replacement in the sense that we could keep the old strings and logo or do we need to change them? If yes, please feel free to suggest something. Also: Is it covering whole Switzerland or only parts of it?

I would say yes. I don't fully know that that, but it's what GNOME Maps uses and I'm pretty sure it works fine.

Yes, this covers whole Switzerland. Regarding the logo and strings: I think its best if we keep the SBB logo (to avoid user confusion) but maybe use "search.ch" as name. Moreover, I found nothing in this regard in their ToS

Personally I think we should also keep the name. As otherwise the logo and name would be mismatched. And the Swiss won't recognise search.ch

@ialokim
Copy link
Collaborator

ialokim commented Jul 17, 2022

Okay, so lets keep everything as is for now, that's also easiest :)

@ialokim
Copy link
Collaborator

ialokim commented Jul 17, 2022

I've tried to add the new provider, but at least on my Android emulator with Android 5.1 (API 22), Transportr crashes when selecting a station with

2022-07-18 01:34:27.782 3686-3776/de.grobox.liberario E/AndroidRuntime: FATAL EXCEPTION: ModernAsyncTask #1
    Process: de.grobox.liberario, PID: 3686
    java.lang.RuntimeException: An error occurred while executing doInBackground()
        at androidx.loader.content.ModernAsyncTask$3.done(ModernAsyncTask.java:164)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
        at java.util.concurrent.FutureTask.run(FutureTask.java:242)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: java.lang.NoClassDefFoundError: de.schildbach.pte.-$$Lambda$CHSearchProvider$CANXaoklrIOChA4w5NFUoPkaH78
        at de.schildbach.pte.CHSearchProvider.queryDepartures(CHSearchProvider.java:166)
        at de.grobox.transportr.departures.DeparturesLoader.loadInBackground(DeparturesLoader.java:63)
        at de.grobox.transportr.departures.DeparturesLoader.loadInBackground(DeparturesLoader.java:35)
        at androidx.loader.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
        at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
        at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
        at androidx.loader.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
        at java.lang.Thread.run(Thread.java:818) 

Similar things happen when searching for trips. It seems to be connected to the usage of anonymous functions in this provider, for example on the referenced line 166: https://gitlab.com/opentransitmap/public-transport-enabler/-/commit/9fb27a523c5e96a40261a12899aecca439918fbc#a6238f309ec31059e54599ca63e583410d7b57d8_0_166

I was suspecting Proguard to optimize this class away, but looking into the APK within IntelliJ shows the class as present. The same problem happens on both debug and release builds.

I don't have ideas how to solve this issue for now. If someone feels like looking into it, the current version can be found on branch release-2.1.5.

Btw, Android 12 (API 31) works as expected.

@ialokim
Copy link
Collaborator

ialokim commented Jul 19, 2022

seems fixed with 092b6ab

@ialokim
Copy link
Collaborator

ialokim commented Jul 20, 2022

seems fixed with 092b6ab

@sirtoobii actually after discussing with @grote we would prefer not enabling library desugaring in general since it might lead to other, difficult to diagnose, problems in the long run. Could you perhaps instead try to rewrite some lines of your PTE provider to make it java 6 compatible, basically removing lambda expressions / replacing them by usual for-loops?

@sirtoobii
Copy link

Could you perhaps instead try to rewrite some lines of your PTE provider to make it java 6 compatible, basically removing lambda expressions / replacing them by usual for-loops?

Done: https://gitlab.com/opentransitmap/public-transport-enabler/-/merge_requests/10
And here: schildbach/public-transport-enabler#481

@Mannshoch
Copy link
Author

For the Record, I found https://github.com/OpendataCH/Transport do jou use this API in Transportr?

@sirtoobii
Copy link

For the Record, I found https://github.com/OpendataCH/Transport do jou use this API in Transportr?

This implementation uses the same source as http://transport.opendata.ch/ (in german: https://opendata.ch/news/search-ch-rettet-transport-opendata-ch/#pll_switcher)

@julianfairfax
Copy link

Looking forward to seeing this in Transportr

@julianfairfax
Copy link

There hasn't been any activity on the GitLab issue for a bit now. What's going on?

@ialokim ialokim mentioned this issue Nov 12, 2023
11 tasks
ialokim added a commit that referenced this issue Nov 14, 2023
@Altonss Altonss linked a pull request Dec 6, 2023 that will close this issue
11 tasks
ialokim added a commit that referenced this issue Jan 7, 2024
grote pushed a commit that referenced this issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 A functional defect or unexpected behavior. coverage 🗺️ This is related to the geographic areas supported. upstream 🏞️ Related to an upstream issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@grote @iGormilhit @sirtoobii @Mannshoch @ialokim @julianfairfax and others