Possible bug in nRF Cloud UI display of device shadow null properties

Hi,

We are seeing weird behavior in the way the nRF Cloud UI displays changes in the device shadow, specifically for properties that are being nulled-out.

Let's say we have propertyA in the "desired" config section:

"config": {

  "cfg":{

     "propertyA": "abc"

  }

}

This displays as expected in the device shadow panel of the nRF Cloud UI.

We can use the "View Config" button to change propertyA to "def", and commit.

{

 "cfg": {

     "propertyA": "def"

  }

}

The shadow panel updates propertyA within a few seconds to "def", as expected.

However, if we want to remove propertyA by setting it to null (as per device shadow semantics) it behaves differently. Again, we use the "View Config" button:

{

 "cfg": {

     "propertyA": null

  }

}

Now, this happens: 

Briefly, the device shadow panel shows "propertyA": null. However, a few seconds it flips back to the previous value "def". Finally, after several minutes, it updates again and propertyA is removed (as we expected in the first place). Then it stays like that.

To verify, we monitored the shadow messages between nRF Cloud and AWS (via nRF Cloud Message Routing). We confirmed that propertyA is immediately removed from the shadow, as expected. But the nRF Cloud UI doesn't reflect that, at least initially.

This is quite confusing and threw us off for a while because we thought it was due to a bug in our shadow handling implementation. Until we realized it's the way the nRF Cloud UI is displaying it.

Parents
  •   - I did some digging into this, and found that AWS handles null values slightly differently than string values. I made a small update to how we display null values in the UI. What you should see now is when you update the config values on the Device Configuration modal it should update right away in the shadow display even if you're adding null values. The shadow display will not display {"property": null}- it will not display anything due to how AWS is handling null values.

    Can you clear your cache completely and take a look at the updated displays? I think this will better meet your needs, but I'd love to get your input.

    I was not able to replicate the scenario where the value changed initially and then changed back.

    Let me know your thoughts when you're able.

Reply
  •   - I did some digging into this, and found that AWS handles null values slightly differently than string values. I made a small update to how we display null values in the UI. What you should see now is when you update the config values on the Device Configuration modal it should update right away in the shadow display even if you're adding null values. The shadow display will not display {"property": null}- it will not display anything due to how AWS is handling null values.

    Can you clear your cache completely and take a look at the updated displays? I think this will better meet your needs, but I'd love to get your input.

    I was not able to replicate the scenario where the value changed initially and then changed back.

    Let me know your thoughts when you're able.

Children
Related