Skip to content

afterrequestdevice event is not shown if you cancel/otherwise error #61

@microbit-matt-hillsdon

Description

@microbit-matt-hillsdon

Python does this, presumably as a workaround:

  private async handleWebUSBError(
    e: any,
    userAction: ConnectionAction,
    finalFocusRef: FinalFocusRef
  ) {
    if (e instanceof DeviceError) {
      this.device.dispatchTypedEvent(
        "afterrequestdevice",
        new AfterRequestDevice()
      );

We should switch to try/finally in the connection library and remove this workaround on debug.

Check for the same bug in the bluetooth code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions