40ants / 40ants/reblocks

UI events race condition

未關閉
#8 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Common Lisp
星號
101
分支
12
PR 合併指標
30 天內沒有已合併 PR

描述

"Click on the "render many" button and wait for it to finish rendering.
Then click again on "render many" and without delay click on "render few"
You will see that AFTER "render few" (the last action from the UI) has finished doing its work,
the results will be replaced by an older action from the UI ...
How to avoid this? In a filtering widget for example, typing a word fast will result in the wrong filtration of a long list.
(after if finishes rendering the newest results according to the last input word, it will then render the previous results from the previous UI action when
the word was only partially typed into the box) https://gist.github.com/bamboospirit/33f6b32f21db22fd48e3724648cf33dc
sbcl sometimes reports hash-table concurrent access error because make-js-action is called in render methods which are being executed concurrently"

This is a race condition and I can't imagine a good generic way to get rid of it because desired behaviour highly depends on application logic.
The correct way would be adding some sort of lock to serialize access to the widget from different actions. Also it might be a good idea to protect with locks other objects accessed from actions. But again, this depends on the application logic.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。