Some keyboard keystrokes are lost while synchronous server calls
Categories
(Core :: DOM: Networking, defect, P2)
Tracking
()
People
(Reporter: l.miller, Assigned: sefeng)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged])
Attachments
(2 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0
Steps to reproduce:
Open the attached html file with Firefox 78.0.2. Type fast ex. "1234567890" at the input field. Notice that some symbols are lost.
Other browsers (Chrome 84.0.4147.89, Internet Explorer 11.0.9600.17843, Edge 84.0.522.40, Safari 13.1.2.) does not have this bug.
Actual results:
Not all typed symbols do present at the input field.
Expected results:
Well, all typed symbols should present at the input field.
We know that syncronous server calls are not recommended but there are some use cases when they cannot be avoided. For example while a user typing we should validate the user input syncronously at server side, and either allow input or disallow it at keypress event handler.
Comment 2•4 years ago
|
||
Hi,
I was also able to replicate the issue on my end. I'm using windows 10 pro, firefox nightly 82.0a1 (2020-09-04) (64-Bit), beta 81.0b4 and release 80.0. (does not happen in Crome)
I will move this over to a component so developers can take a look over it. If is not the correct component please feel free to change it to an appropriate one.
Thanks for the report.
Best regards, Clara.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
l.miller, it seems like it should be possible to design a UI that does not require that.
Olli, this is a bug caused by synchronous XMLHttpRequest having a nested event loop. Perhaps it's more feasible to fix this with e10s-multi?
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Yes, sync XHR causes Gecko to prevent user interaction events.
Note, last time I checked, all the browsers get input events in a weird way when sync XHR is running - missing events or in a wrong order (but that was awhile ago when I tested).
e10s-multi as such doesn't help here. What we could do is to let input events get queued, but not process any of them until the sync operation is done. That would be relatively easy to implement (in child processes) given that there is a separate queue for input events these days.
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
There are two issues in our current setup
-
Input events which are occurring in the same tab are going to be lost
because sync XHR. We have event handling suppression for synx XHR, so input
events are going to be discarded. -
Input events that are happening in another tab (same process as the
synx XHR tab) are not going to be delayed. This is not correct since
sync XHR should block the Javascript execution.
This patches fixes the above cases for when both TaskController and e10s are
enabled by suspending the InputTaskManager during sync XHR, which
delays the input event handling and keeps the events around.
Assignee | ||
Comment 6•4 years ago
|
||
This grants us the ability to rely on InputTaskManager
to suspend
input events when needed.
Updated•3 years ago
|
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/432c83951167 Fix input events handling for sync XHR when both TaskController and e10s are enabled r=smaug
Comment 8•3 years ago
|
||
Backed out for perma failures.
Log: https://treeherder.mozilla.org/logviewer?job_id=323479241&repo=autoland&lineNumber=2417
Backout: https://hg.mozilla.org/integration/autoland/rev/6c4d25735ce2fc383b6f2d96cbd182546b4bc3c0
Pushed by sefeng@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/778e524a9f31 Fix input events handling for sync XHR when both TaskController and e10s are enabled r=smaug
Comment 10•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Reporter | ||
Comment 11•3 years ago
|
||
It is reported that the error is fixed at the version 86. We have checked up a Nightly build 87.0a1 and the error is still there. Should we check later versions? If yes then which ones?
Thank you.
Assignee | ||
Comment 12•3 years ago
|
||
Sorry, the fix is behind the dom.input_events.canSuspendInBCG.enabled
pref, and it's currently disabled.
Description
•