-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selection check infinite loop kicks in too often #3785
Comments
This is even easier to trigger (which makes it pretty critical). Just keep pressing backspace for a longer time. The warning will be logged pretty quickly. |
After fixing #3701 selection infinite loop kicks in also happen at the edge of |
I can't reproduce this. However in this case:
The warning/check kicks in incorrectly. When you comment out the whole if nothing breaks or crashes (no infinite loop). |
Okay it appears that the Maybe clear it on timeout? Or add |
I think that what we want to check is the number of selection changes in a period of time. Like whether 100 last changes happened in a second. If that's true, then we have loop. The first way to implement this which comes to my mind is having an array of last change timestamps. You add the current one and checks the one that you remove (like in a FIFO queue). I guess there may be smarter ways too :D. Anyway, this should not fail us. In fact, this is how I thought it worked. |
PS. The numbers must be chosen in such a way that it won't fail in automated tests :D. But it should be fine if in every |
Fixed by ckeditor/ckeditor5-engine#671. |
If you do it frequently enough and repeat enough times you got:
and the seleciton stops refreshing (the label of the headings dropdown stops updating).
Now, god bless our marvellous idea to log stuff like this to the console!!! Imagine the hours spent on debugging this security check if it ended up with a silent errror.
The text was updated successfully, but these errors were encountered: