pxt-microbit icon indicating copy to clipboard operation
pxt-microbit copied to clipboard

WebUSB disconnect gets the website into inconsistent state

Open abchatra opened this issue 1 year ago • 2 comments

To Reproduce Steps to reproduce the behavior:

  1. Connect webusb to microbit
  2. Click on '...' in download dialog and click disconnect
  3. Try connect again.
  4. See error

abchatra avatar Aug 30 '24 18:08 abchatra

May be easy fix is to revert to the original behavior of asking user to disconnect in the Chrome UI.

abchatra avatar Aug 30 '24 18:08 abchatra

The error hits here, failing to open device when reconnecting https://github.com/microsoft/pxt/blob/ca77f84310df2b70973b9ef65715c039b204cd70/pxtlib/webusb.ts#L464 -- refreshing the page, or disconnecting microbit & reconnecting as the modal instructs both resolve the issue. For now we're punting this problem from the release as it's not a regression, disconnect is rarely used (especially w/ regards to immediately reconnecting), and we'd just be swapping out modal with instructions for more work on the user side + a little chrome warning to refresh that they'd likely end up ignoring as well.

jwunderl avatar Sep 03 '24 20:09 jwunderl