sg-wireless / pymakr-vsc

GNU General Public License v3.0
97 stars 25 forks source link

[BUG] Null exception when adding/creating a telnet device #281

Open PiniponSelvagem opened 1 year ago

PiniponSelvagem commented 1 year ago

Adding a new serial device works as expected, but adding a new telnet device throws a null exception to the notification area. This also makes the "Devices" section unusable until removing the new telnet device from "pymakr.devices.configs".

Steps to reproduce the behavior:

  1. Go to Pymakr extension
  2. Open "Devices" section
  3. Click the '+' to add a new device for "Serial"
  4. Follow the input prompt until the end and complete it (working as intended until here)
  5. Click the '+' to add a new device for "Telnet"
  6. Follow the input prompt until the end and complete it
  7. Notice that the "Devices" section resets to the initial state with the 2 buttons that show: "Unhide a hidden device" and "List all devices". The serial device disappeared and a VScode notification about a null exception shows up at the corner. (problem occurred)
  8. Open vscode settings file: "settings.json"
  9. Scroll down to "pymakr.devices.configs"
  10. Remove the telnet device "telnet://". Notice that the name of the device is blank, even though it was asked for an input during creation.
  11. Reload VScode
  12. Pymakr "Devices" window works again

Expected behavior Newly added telnet device should add successfully and then be able to use it to connect to the device.

Screenshots After adding the 1st device (serial): Capture1

New device > Telnet: Capture2

Input for device name: Capture3

Device section got reset to initial state. Also notice that the "name" is blank, even though my input was "TTGOwifi". Capture4

Desktop (please complete the following information):

Additional context Log that shows the error with 2 "New Device" creations:

  1. 1st exception was after creating a new telnet device.
  2. Deleted the telnet device from "settings.json" from VScode settings.
  3. Reloaded VSCode window.
  4. 2nd exception after creating a new telnet device. (Same result.) vscode-app-1666110927555.log
jakobrosenberg commented 1 year ago

Hi @PiniponSelvagem . Telnet connectivity was an upcoming feature pending a new in-house driver to replace the current 3rd party drive, with which we had some issues.

The Telnet option shouldn't have been visible yet and can be considered a bug in the UI.