f4lco / om-parser-stw-potsdam-v2

Connect canteens of the Studentenwerk Potsdam to OpenMensa
3 stars 7 forks source link

Builds fail, live system fails with error 500 #11

Closed kaifabian closed 4 years ago

kaifabian commented 4 years ago

https://travis-ci.org/f4lco/om-parser-stw-potsdam-v2:

    def _active_days(menu):
>       for container in menu['wochentage']:
E       TypeError: 'NoneType' object has no attribute '__getitem__'
f4lco commented 4 years ago

Thanks for noticing! I was aware of the build failures, but did not have the time for finding their cause: the response for canteens Brandenburg, Golm, Palais, Kiepenheuerallee consists of null.

Because the website also errs with the following error on the console:

Guru-Meditation: Fehler beim laden der JSON-Daten
TypeError: Cannot read property 'globalLaufschrift' of null
    at H.initDataFromApi (app.js?1575447077:1)
    at vendor.js?1575447078:6
    at vendor.js?1575447078:6
    at Array.forEach (<anonymous>)
    at vendor.js?1575447078:6
    at H._withCommit (vendor.js?1575447078:6)
    at H.commit (vendor.js?1575447078:6)
    at Object.H.commit (vendor.js?1575447078:6)
    at app.js?1575447077:1

this appears to be a general problem. Also, the website shows an infinite loading spinner for those canteens.

As a result, this is a variation of #6: invalid API responses. We already guard against invalid JSON (which does not fail the test or the build). Unluckily, null qualifies as valid JSON. It's difficult to draw a line between "API changed" and "API returned garbage". If you have any ideas, feel free to comment on #6. At the moment, I do not think further action is required.