Open f4lco opened 6 years ago
I noticed that occasionally they keep their debug preamble together with valid meals and break their own website. Apparently this is subject to 'Guru Meditation':
d.a.post(e.state.dataUrl, n).then(function(t) {
200 === t.status && (e.commit("initDataFromApi", t.data),
e.commit("updateEtageData"),
e.commit("updateElsTags"),
e.commit("updateFreitagsModus"),
e.commit("updateMealsAfterAllSettings"),
e.commit("sortOutMeals"),
e.commit("mapMealsToSpeiseplan"))
}).catch(function(t) {
console.log("Guru-Meditation: Fehler beim laden der JSON-Daten"),
console.log(t),
e.commit("initDataApiFailed")
})
Also the 'empty meals' case is apparently not anticipated from their side (see JSON snippet from previous comment), since in this case ajaxData
fails to populate:
initDataFromApi: function(e, t) {
e.fullAjaxObj = t,
e.globalLaufschrift = t.globalLaufschrift,
e.ajaxData = t.wochentage[e.day].datum.angebote,
e.datumData = t.wochentage[e.day].datum,
e.ajaxWorking = !0
}
(both are excerpts of the pretty-printed source of the canteen website's JS). Both observations were made for Wildau on 2018-11-13.
The build health is also determined by the cron build which tests for parseable API output once per day. However, the API is a little unstable and at times the JSON endpoint returns outputs of the following kind:
To my opinion, there is nothing we can really do about it. Option one - current state - is to fail loudly and to signal to clients that something went wrong. Option two - best-effort parsing of the API response - would recover exactly zero meals, which does not really justify the work required to implement the heuristic.