Dispatch was operating with two open tabs one for 2024-06-14 and one for 2024-06-15
Robingo rider was doing deliveries for 2024-06-14 so had a full list of assignment
One delivery popped up for 2024-06-15 so the dispatcher switch tabs
When he assigned tasks to robingo, all tasks from 2024-06-14 were unassigned from Robingo
the incident occured at 21:30. Hour may be interesting here, maybe not, because we are at GMT+2 (Nantes), so it does not seem like a timezone problem.
The bug was repeated two days later on naofood with another rider (Belreypaire), approximatively at the same hour.
Hypothesis 1
The problem is caused by the websocket connection, the "v2:task_list:updated" event is sent to both tabs. However the code is faulty, as it doesn't check for the date before updating the tasklist, just get by username, so it will override in one of the two tabs the tasklist with data from another day.
It sounds plausible but I didnt manage to reproduce the bug locally yet.
Reported for naofood instance by paul https://coopcycle.slack.com/archives/G01JR0YF5V3/p1718405453408319
What happened?
the incident occured at 21:30. Hour may be interesting here, maybe not, because we are at GMT+2 (Nantes), so it does not seem like a timezone problem.
The bug was repeated two days later on naofood with another rider (Belreypaire), approximatively at the same hour.
Hypothesis 1
The problem is caused by the websocket connection, the "v2:task_list:updated" event is sent to both tabs. However the code is faulty, as it doesn't check for the date before updating the tasklist, just get by username, so it will override in one of the two tabs the tasklist with data from another day.
It sounds plausible but I didnt manage to reproduce the bug locally yet.