Kanban Boards revert column changes made by other users without user interaction
See original GitHub issueDescription of the issue
I have users who keep one of my kanban boards open. Recently a newly trained member of our team was organizing card on the kanban board, when he was dismayed to see that the work he was doing was being undone, and the cards were moving back into their original column!
Here is an example where Grant updated a document by moving it between kanban columns while Luke had two browser tabs open to the kanban board. Luke had left the tabs open from the previous day, but he never touched them on the day this happened.
It is noteworthy that Grant moved a second card within a few minutes of the first, and the same changes occurred on the second card by Luke at exactly the same time as on the first card.
Context information (for bug reports)
This was a difficult bug to track down, because it isn’t guaranteed to happen every time someone moves a card even if the proper environment is set up to reproduce the bug. However, I was able to pin down the cause to this POST request, which had the same timestamp as the modified time on the document that was improperly updated:
Request URL: https://foo.com/api/method/frappe.desk.doctype.kanban_board.kanban_board.update_order
Request Method: POST
Status Code: 200 OK
This makes sense, because the update_order
call sends every card, including the list they are in, in the body of the POST request.
What I don’t understand is why.
a) What triggers the call to update_order
? Is it time based? Is the browser failing to receive some sort of update in time?
b) Why is there a call to update_order
in the first place: especially when the user isn’t interacting with the page, but even IF the user is interacting with the page. See c) below
c) There is a function called update_order_for_single_card
that should work for any deliberate modifications to the order of cards that a user can perform on a board. Under what circumstances should the browser update the order of all cards on a board?
Output of bench version
ERPNext: v13.36.1 (version-13)
Frappe Framework: v13.36.2 (version-13)
Steps to reproduce the issue
- Have multiple people open the same kanban board, preferably staggered (in case staggering when the board is opened helps to replicate the issue sooner).
- Move a card between kanban columns and wait up to 10m.
- Monitor the database using something like
SELECT name, modified, modified_by FROM
tab[DOCTYPE]ORDER BY modified DESC
, or waiting until the change is reflected in the other user’s browser tabs after an automatic update of the kanban board. - Repeat until the card is modified by someone other than the person who moved the card.
Observed result
Every once in a while, the last person who modifies the card won’t be the person who moved it. In that case, the column will change back to the original column when the value of the field is reverted.
Expected result
Cards should remain in the selected column unless they are physically moved to a different column or the column field is updated by a person on the Document itself.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top GitHub Comments
This video show the issue with all its beauty 😉
Even without manual refreshing … after a while, some kind of autorefresh launchs /api/method/frappe.desk.doctype.kanban_board.kanban_board.update_order
@git-avc I can confirm, Kanban board is a big mess. Tried to improve it, but failed: https://github.com/frappe/frappe/pull/17424#issuecomment-1269648947