when entering the calendar menu, the calendar app is not loading at all, showing a blank screen. when selecting a show, the calendar briefly loads up but crashes immediately. this is probably related to some of the recent updates in dashboard & steering? (@kmohrf and @eigenwijsje )
Once I’ve fixed the other bug that prevented me from completing your repro-case I wasn’t able to reproduce this. Does the repro still work for you @Loxbie? If so: do you have time for a quick 1-on-1 in order to debug this?
I’ve found the bug, but I’m not entirely sure how to proceed.
The error originates in the by-day view of the calendar [1]. When the calendar page is opened two things happen:
all timeslots of the current week are loaded
playlists for the currently selected show are loaded
day-view renders all timeslots of the current day including the respective playlist description of the timeslot
Step 3 only works, if the timeslot belongs to the same show that is currently selected or the timeslot does not have a playlist, because only playlists for the currently selected show were loaded and data for any other playlists is not available.
The quick fix is to hide the description in case we don’t have the data right now.
The proper fix would be to rework the playlists store (it’s rather small) to fetch playlists not by show when switching from show to show, but on-demand by id. This would also avoid re-polling the tank API on every show switch.
I’m inclined to do both :). Quick fix now, proper fix when we feel it fits in our sprint schedule. Any thoughts @fm_margarethem?
[1]: Both the by-week and by-day view are rendered when the calendar nav link is clicked though only one is shown at a time. Technically these should be two distinct components embedded on the same page, but that’s another discussion entirely.
@kmohrf I cannot confirm the relation to the day view. Because to me this happens at initial loading of the weekly view already. As Ole mentioned above you can reproduce this at dashboard.aura.radio:
I'm not able to create a timeslot.
Steps to reproduce:
login
click "calender"
the calendar pops-up for a brief moment but then disappears.
The day-view is still rendered even if you are currently using the week-view, because the view-switch only toggles them visually. Therefore any bug or error in either the day-view or the week-view might affect the other one as well.
I tried to make that transparent in the footnote:
[1]: Both the by-week and by-day view are rendered when the calendar nav link is clicked though only one is shown at a time. Technically these should be two distinct components embedded on the same page, but that’s another discussion entirely.
@david I think this happens as soon as someone follows the steps I mentioned earlier. Then the calendar breaks and will only render the specific show with which the bug was "spawned". That is why you could not see the calendar yesterday. Today it is working again, as for now
@kmohrf Would it help to split the day-view and the week-view in two separate pages? For example /calendar and /calendar-day or something similar.
It would help in the sense that it would’t crash the week-view anymore, but it would still affect the day-view. I plan on refactoring this page anyway and part of that would be to isolate self-contained parts and split them into separate components but I wasn’t planning on doing that right now.
The main culprit is the way we fetch data from tank. The (missing) component separation just adds to that problem.
I can add one more bit of context to the issue: I use Firefox with adblock plus and noscript. I had the problem of the calendar rendering not correctly once I switched from day view to week view. Disabling the scriptblock plugin did not make a change. On disabling the adblocker completely, showing the day view works. But now when I switch back from day view to week view, the week view still renders the slots in a crammed way (see screenshot). Simply reloading the page then resolves this.