-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UpdateReportedPropertiesAsync not updating device twin #340
Comments
I can also reproduce this it seems to not write properties when you are using arrays.
Is it not possible to have a json array in the twin data? |
For me its failing in all cases. Following is the code snippet wherein it fails and doesn't update the reported properties for the device. `TwinCollection test = new TwinCollection(
Following is the formatted Json { |
@amogh79 you can get yours to work if you omit the "$" in the "$version" property it doesn't seem to like properties that begin with $ |
Jeez how come I forgot that properties starting with "$" are readonly. Thanks for your inputs @invinctus. |
@amogh79 does this mean that it worked for you after removing "$"?
The service should return an error. If the "$" was the reason you couldn't update properties, I'd like to repurpose this issue to track the lack of error reporting.
@invinctus Does it work if you add properties on the collection instead of parsing them from a |
@CIPop the documentation does say arrays are not supported I didn't notice that initially. The biggest issue really is the lack of error reporting when you try to write something that is not supported. |
Thanks @amogh79 and @invinctus ! Glad to see you are unblocked! @simonporter I'm not very familiar with the Service SDK but in general we would expect the server side to report back if any of the data was incorrect. Is there any reason that the server would accept both the array and $ param changes silently? |
If we send invalid names in reported properties service will send back rejection with status 400. I added handler for that, currently in PR. As soon it will be merged I will close this issue. Best Regards, |
OS and version used: Windows 10
SDK version used: Microsoft.Azure.Devices.Client 1.6.1
Description of the issue:
I am simulating a device for desired properties changed event. I am using UpdateReportedPropertiesAsync method on DeviceClient to update reported properties, I don't get any error but the reported properties for the device are not getting updated. I checked both on IoT hub and retrieving the devicetwin using GetTwinAsync from within the code. We are nearing a release next week and any help on this would be highly appreciated.
Code sample exhibiting the issue:
Console log of the issue:
The text was updated successfully, but these errors were encountered: