Azure / Azure/azure-iot-sdk-node

Message routing not working for null value in properties

Open
#1,226 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
268
Forks
228
PR merge metrics
No merged PRs in 30d

Description

I have a message route query on iotHub like below:-
IS_OBJECT($twin.properties.reported.deviceOperations) OR $twin.properties.reported.deviceOperations = null

Expected result:-

Message should be delivered to the endpoint having twin like below:-
```
"properties": {
"reported": {
"deviceOperations": {
"6a8e9bb0-631b-42ad-a3ec-7c8fe4a67c6c": {
"requestType": "fileDownload",
"metadata": {
"key": "value"
},
"blobName": "",
"progressUpdate": false,
"de88a4ed-6eb0-483b-a929-cf0ae544e0df": {
"wipe": true
}
}
},
}
```
This is getting delivered and is working fine due to the `IS_OBJECT` query in message routing

The problem/issue arises in the second query for json below
```
"properties": {
"reported": {
"deviceOperations": null
}
}
```
this is not getting delivered to the endpoint but it should due to this condition `$twin.properties.reported.deviceOperations = null`.

And the reported property deviceOperations is getting cleared in twin but somehow not delivered to the endpoint.
Also when i put the message routing query as `true` I get the message in my endpoint as below
[EventHubMonitor] [9:21:31 AM] Message received:
```
{
"version": 6,
"properties": {
"reported": {
"deviceOperations": null,
"$metadata": {
"$lastUpdated": "2024-11-26T03:51:31.5199729Z",
"deviceOperations": null
},
"$version": 3
}
}
}
```
So only the condition `$twin.properties.reported.deviceOperations = null` in message routing doesn't work

Am I missing anything?

Note:- The test works in the Azure UI portal for above JSON.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.