Azure / azure-iot-hub-node

Azure IoT Hub Data Plane Node SDK
MIT License
1 stars 7 forks source link

[BUG] Can't update "deviceContent" property of IotHub Configuration #10

Open Apokalypt opened 1 year ago

Apokalypt commented 1 year ago

Context

I would like to be able to update the deviceContent property through the library and/or through the API

Problem encounter

When I call the "Registry.updateConfiguration(...)" all properties seems update but the deviceContent property keep old values.

Code to reproduce

const registry = Registry.fromConnectionString("<ConnectionString>")

const configuration = {
            id: 'extensions-test',
            priority: 2,
            targetCondition: "a valid query",
            content: {
                deviceContent: {
                    'properties.desired.extensions': {
                        id: "a custom id",
                        list: []
                    }
                },
                moduleContent: { },
                modulesContent: { }
            },
            labels: { },
            metrics: {
                queries: { },
                results: { }
            },
            etag: ''
}
await registry.addConfiguration(configuration)

configuration.content.deviceContent['properties.desired.extensions'] = {
       id: "a new custom id",
       list: [{ name: "a name", id: "a valid id" }]
}
await registry.updateConfiguration(configuration, true)

After the code above, the device content property has the old value ({ id: "a custom id", files: [] }) instead of the new one.

I also try to call the API (api-version=2020-09-30) directly but I have the same result...