Azure / pcs-remote-monitoring-webui

Azure IoT PCS Remote Monitoring Web UI
MIT License
54 stars 72 forks source link

User is kept waiting without notification, when trying to add a rule for a device that has an undefined messageSchema #1222

Closed andren closed 5 years ago

andren commented 5 years ago

Type of issue

Description

When attempting to add a rule to a device group that contains a device that has an undefined MessageSchema, users don't get any error notifications.

An exception is triggered and reported in the console, however the message is not clear for one unfamiliar with the codebase. The exception message is something along the lines of: "can't find fields of undefined" in line 291 of ruleEditor.js.

Steps to reproduce

  1. Add a device with an undefined MessageSchema
  2. Add the device to a device group
  3. Attempt to add a rule, and on selecting Device Group the UI should get stuck loading as shown in the screenshot section below

Expected behavior

A warning that lets a user know something along the lines of: "Your device twin does not have a defined messageSchema"

Current behavior

Eternal waiting... :(

Known workarounds

NA

Possible solution

getConditionFields should try to get these conditionFields within a certain timeframe, and if it is unsucessful, it should resurface with a visual error box on the UI.

Context and Environment

Screenshot

image