Skip to content
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

Intermittent "NotAllowedError: Failed to write the report." on Chrome v115+ #92

Closed
KhangxLi opened this issue Oct 24, 2023 · 6 comments · Fixed by #93
Closed

Intermittent "NotAllowedError: Failed to write the report." on Chrome v115+ #92

KhangxLi opened this issue Oct 24, 2023 · 6 comments · Fixed by #93

Comments

@KhangxLi
Copy link

KhangxLi commented Oct 24, 2023

The following uncaught exception (or promise rejection, not sure) "NotAllowedError: Failed to write the report." gets thrown from within function setupXkeysPanel.

On Chrome versions 117+ (tested on 117, 118, 120), this happens consistently until Chrome is restarted* ( can use chrome://restart ). *The issue gets resolved only after a random number of Chrome restarts and sometimes requiring XKeys to be replugged. The issue can then be reintroduced after a certain random number of Chrome restarts again.

The issue is never reproduced on Chrome v115 and below. Chrome v116 behaviour is untested.

In Chrome device log ( chrome://device-log/ ) I see either one of these 2 errors when the issue occurs when calling setupXkeysPanel:

  • Output report buffer too long (36 > 2).
  • This device does not support output reports.

Reproduced with:

  • XKeys: vendorId=1523, productId=1089, name='XK-80 HID'

Any ideas?

@michaelhatPIengineering
Copy link
Collaborator

This is the first we have heard of. The output report has stayed the same.
It may be trying to write to the wrong end point.
The X-keys is several "devices" to the OS as it is a compound USB device.
Be sure to check the write length is longer than 20 or HID usage page 0xc (12 dec
)

Writing to device "0" for example does not always work if the OS enumerates them in a different order.

@Julusian
Copy link
Member

This was pretty easy to reproduce, and I could see that when approving the device it returns 3 different objects where we were always taking the first of this list.

Filtering this to only return and accept ones with usagePage 12 has made the issue go away for me

@KhangxLi KhangxLi changed the title Intermittent "NotAllowedError: Failed to write the report." on Chrome v117+ Intermittent "NotAllowedError: Failed to write the report." on Chrome v115+ Oct 25, 2023
@KhangxLi
Copy link
Author

Correction: Issue might have been present on earlier Chrome version (115) and was exposed by a combination of Windows upgrade and Chrome update.

@michaelhatPIengineering
Copy link
Collaborator

I reviewed with our firmware engineer; she recommends:
filter only on:
VID
PID
Usage page 12
write length > 20
to get the "device" supported by this lib.
other things are redundant or not consistent over all OSs

@KhangxLi
Copy link
Author

thanks guys, I'm able to fix it locally since I can access these fields.

Will update my package once #93 is merged since it seems to also take care of an uncaught promise rejection.

Won't close this issue myself until above is merged

@nytamin
Copy link
Member

nytamin commented Nov 2, 2023

This is now fixed in version v3.0.1, thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants