Skip to content

Edge case defect when importing the first test node into dashboard#763

Merged
marcelveldt merged 2 commits intomatter-js:mainfrom
oidebrett:first_imported_test_node
Jun 18, 2024
Merged

Edge case defect when importing the first test node into dashboard#763
marcelveldt merged 2 commits intomatter-js:mainfrom
oidebrett:first_imported_test_node

Conversation

@oidebrett
Copy link
Copy Markdown
Contributor

Fixed for an edge case defect/bug when importing the first test node using the dashboard via a diagnostics file.

Procedure to replicate bug:

  1. run the python matter server (no matter nodes commissioned)
  2. run the dashboard node app
  3. attempted to try to import a device diagnostic file
  4. the dashboard throws an error in device_controller.py file

File "/home/XXX/Projects/pip-python-matter-server/venv/lib/python3.11/site-packages/matter_server/server/device_controller.py", line 857, in import_test_node next_test_node_id = max(*(x for x in self._nodes), TEST_NODE_START) + 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'int' object is not iterable

Fix for defect:

In the "import_test_node" function in device_controller.py, a check was coded for an empty dict for self._nodes and if empty set the next_test_node_id to TEST_NODE_START

@marcelveldt marcelveldt added the bugfix Pull request that fixes a (known) issue/bug label Jun 18, 2024
Copy link
Copy Markdown
Collaborator

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@marcelveldt marcelveldt merged commit 950663f into matter-js:main Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a (known) issue/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants