avc
October 31, 2022, 6:56pm
1
Hi everyone:
We are facing an issue with kanban view. Refreshing the kanban view updates doctype data wrongly, restoring previous data loaded … maybe I am missing something. Even without user interaction ! Anyone else is facing the same?
There is an issue on Github, opened time ago, but it’s a bit strange that just a few people is talking about it …
opened 06:11PM - 04 Aug 22 UTC
bug
valid
## Description of the issue
I have users who keep one of my kanban boards ope… n. 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.
![image](https://user-images.githubusercontent.com/16672299/182918235-11a99bf6-c937-43f2-98c2-975937a938e8.png)
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
1. Have multiple people open the same kanban board, preferably staggered (in case staggering when the board is opened helps to replicate the issue sooner).
2. Move a card between kanban columns and wait up to 10m.
3. 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.
4. 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.