Skip to content

[Bug]: Nothing happens in the UI when you try to unbind a non-existent group from an endpoint #2742

@realwoopee

Description

@realwoopee

What happened?

Yandex gang switches (YNDX_00531 or YNDX_00532) have a quirk where they sometimes automatically bind their genOnOff output endpoints to groupId=1. If you don't have a group with id=1 configured in z2m, you will have strange rows in the Bind page of your switch that don't have a device/group selected but have bind/unbind buttons active.

Trying to press 'Unbind' button will do nothing to the user, but an error appears in the dev console:

Uncaught TypeError: can't access property "friendly_name", n.find(...) is undefined
    getBidingParams http://192.168.0.2:8099/assets/ConnectedDevicePage-e594f769.js:1
    onBindOrUnBindClick http://192.168.0.2:8099/assets/ConnectedDevicePage-e594f769.js:1
    s http://192.168.0.2:8099/assets/index-6a654fd1.js:71

I checked the docs and saw that you cannot bind/unbind groups by id, so this cannot be easily fixed by passing an id instead of a friendly name.

While this issue can be avoided by just creating an empty group with id=1, showing some kind of an error in the UI would be nice.

I would like to suggest a PR, but I need to find an example of showing a toast to the user first, or think of some other fix (like not showing bindings for non-existent groups, or disabling bind/unbind buttons)

What browsers are you seeing the problem on?

Firefox

Relevant stacktrace

Uncaught TypeError: can't access property "friendly_name", n.find(...) is undefined
    getBidingParams http://192.168.0.2:8099/assets/ConnectedDevicePage-e594f769.js:1
    onBindOrUnBindClick http://192.168.0.2:8099/assets/ConnectedDevicePage-e594f769.js:1
    s http://192.168.0.2:8099/assets/index-6a654fd1.js:71

Did you download state.json.zip?

I will not attach state.json.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions