Open Bug 1657340 Opened 4 years ago Updated 4 years ago

Fast keyboard entry causes character loss in the typed characters (QR code scanner as keyboard)

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

79 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: mezeipetister, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0

Steps to reproduce:

  1. Open Firefox
  2. Open an empty page
  3. Plug in a 2D barcode reader via USB
  4. Scan a QR code, with the following content: http://gardenzilla.hu/upl/1
  5. Repeat it until, the typed string is going to loss a character. In my case /upl/1 is going to be /up/1, so the "l" is missing.

Actual results:

Very very strange behaviour. If I open a gedit, and start to scan with the same barcode reader (Zebra DS2208), there is no error at all. If I scan the same QR code 300 times, all the scans are okay.

If I open Google Chrome, also there is no error at all.

If I open any times Firefox, the same issue occurs.

If I open my web app, and using the same QR code reader in a selected input field, it behaves the same way. Sometimes, there is missing character.

It's very strange, I tested it at least a 1.000 times, and only 2 kind of character missing ocured:

Expected results:

The entered string should be the same all the times, without random character loss.
I checked the QR code and the reader as well. If I do the same test but using any other software, the character loss issue does not occur.

The QR code reader works like: reading the characters from the QR code, and types them one by one, and for last, it sends an enter character.
My first guess was the too fast entry, so scanning 2-3 codes per sec, and auto pressing enters after each other, can cause the issue, but no.
If I just use the scanner slowly, like 1 barcode per 2 sec, then some times the same issue happens.
So now my guess is, there could be some issue during the fast character typing.

Sometimes I got the following misspelled strings:

If I set the QR code scanner, to apply 20 ms delay between key strokes, then the error disappear,
but it becomes extremely slow, so this is not a real life scenario, when doing sales job and scanning product items in a shop.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core

(In reply to Release mgmt bot [:sylvestre / :calixte / :marco for bugbug] from comment #4)

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Maybe..

Doesn't look like a graphics issue to me. Also, this could be very annoying to the users if they type something and Firefox misses the characters.

Component: Graphics: WebRender → DOM: UI Events & Focus Handling

Sounds like dup of bug 1098981, but it should occur only when KeyboadEvent.repeat is set to true.
Could you check the .repeat value with in the test suite? I guess that the scanner generates same hardware keycode events and we drop some events to avoid content process being busy.

Blocks: 1640599
Flags: needinfo?(mezeipetister)

But if I use the barcode scanner and scan the code to the Firefox address bar, the same issue occurs. Does that means something?

Flags: needinfo?(mezeipetister)
Attached image test_a.png

You can see what happens when there is a missing U from /upl/, so it types just /pl/
Based on the tool results, its like pressing up the U character (event #121), but there is no press down event to the U character.

Attached image test_b.png

It also strange, that it types http://, but in the event list there is no sign of it. Its like starting with event #47, by pressing g. But the http:// is typed.. If i type it by my hand, then it starts from event 1 and it displays the key events for the http:// part as well.

Attached image test_3.png

Here, the / is missing after /upl. So instead of /upl/1, it typed /upl1
The tool shows a similar issue. Event #138/139 shows, there were keyup + 6 event, but there is no keydown + 6 before.

Also in my tests, the .repeat was never true.

And one important thing. My barcode reader is in HID emulation mode, so it emulates itself as a keyboard. This issue is only occurs when using Firefox.

Should I do more tests?

(In reply to Peter Mezei from comment #8)

But if I use the barcode scanner and scan the code to the Firefox address bar, the same issue occurs. Does that means something?

Yeah, that means you hit another bug.

According to your test result, the scanner types keys faster than communicating with your IME. I guess that it works with <input style="ime-mode: disabled;">. Could you check it? (I still don't have idea how to fix it if my guess is right...)

Flags: needinfo?(mezeipetister)

Is there any way to manage it using your tool?
I created a small html test - using my opened angular project -, and using <input style="ime-mode: disabled;"> the same issue occurs.

The html source code:

<input style="ime-mode: disabled;" #input>
<br>
<button (click)="input.value=''; input.focus()">Clear</button>

It's also worth to mention, that this issue only occurs in 1-2 of 10 times. So if I scan the same code, 8 out of 10, it is going to be correct, and 1-2 out of 10 is going to be with missing characters.

So it's strange, I guess the barcode reader has the same scan and type speed as constant.

Flags: needinfo?(mezeipetister)
Attached image input_demo.png

The same issue did occur hhen I did the test, using the following html code:

<input style="ime-mode: disabled;" #input>
<br>
<button (click)="input.value=''; input.focus()">Clear</button>

And it's also interesting that; It's like there might be a pattern in the missing character cases.
Till now, I found only 3 types, of repeating issues
When I use this barcode content: http://gardenzilla.hu/upl/1 then:

  • http:// => one t is missing sometimes, so htp://
  • gardenzilla.hu is always perfect
  • /upl/1 sometimes u is missing, so pl/,
  • /upl/1 sometimes the last / is missing, so /upl
  • /-upl/1, the last part after the last / is an integer. Whatever integer is there, the value is always correct, so there is no missing character at all.

And what I wrote before. Scanning to an html field, or scanning to the Firefox address bar, the issue occurs only 1-2 times out of 10.

I think that I should be back this bug after beforeinput event support. Probably, we need to think how to support ibus/fcitx's hacky async IME support.

Severity: -- → S3
Priority: -- → P3

And do you think its something that I can wait for in a short period of time, to be fixed; or Its something that will be fixed in long term?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: