microsoft / jacdac

Device and service catalogs for Jacdac.
https://aka.ms/jacdac
Creative Commons Attribution 4.0 International
66 stars 25 forks source link

micro:bit "add blocks" allows adding an extension already present #280

Closed tballmsft closed 3 years ago

tballmsft commented 3 years ago

The new dialog for "add blocks" does not check to see if an extension is already present. As a result, it is possible to add the same extension twice, which leads to compile errors.

pelikhan commented 3 years ago

Can you share the project with the conflicting import? The dialog should be updating existing references.

tballmsft commented 3 years ago

The repro is very simple (no hardware required):

  1. add pxt-jacdac extension
  2. add a button via the simulator
  3. press the "add blocks" button and add "button" extension
  4. press the "add blocks" button again and see that the "button" extension still appears in the dialog

Expected behavior: at step "4", there either shouldn't be an "add blocks" button, it should be greyed out, or pushing the button shouldn't list the "button" extension in the dialog.

pelikhan commented 3 years ago

The simulator does not really know which extension have been loaded. I can rephrase the dialog to be "Add or update extensions", which is really what it is doing.