coopcycle / coopcycle-web

Logistics & marketplace platform. Only for worker-owned business.
https://coopcycle.org
Other
564 stars 128 forks source link

Dispatch bug when assigning tasks on different days in two different dashboard tabs (reported by Naofoo) #4421

Closed Atala closed 3 months ago

Atala commented 3 months ago

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.