-
Notifications
You must be signed in to change notification settings - Fork 493
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
SetDesiredPropertyUpdateCallback() is not working. #45
Comments
Based on investigation, the code creates the first chain of inner handlers correctly and sets the callback. However, within the call of SetDesiredPropretyUpdateCallback(), the code resets part of the chain without setting the callback again - so it gets lost. |
Jasmine pointed me to the sample, and the problem is that I’m missing the explicit call to OpenAsync()
Once I added this, things started to work. This makes sense, because when I debugged SetDesiredPropertyUpdateCallback(), it ended-up calling OpenAsync(), and during that call the callback was lost. In other words, the code path for OpenAsync() does not expect the callbacks to be set, and overwrites them. So, if SetDesiredPropertyUpdateCallback() is expected to handle the case where OpenAsync() hasn't been called yet - we might still have a bug. |
The is a valid bug and SetDesiredPropertyUpdateCallback() is expected to handle the case where OpenAsync() hasn't been called. Fix is on the way. Thanks. |
commit: ccd8bc9 |
I'm trying to run the sample (https://github.com/Azure/azure-iot-sdk-csharp/blob/master/device/samples/DeviceClientTwinMqttSample/Program.cs), but it crashes on:
Connecting to hub Error in sample: System.NullReferenceException: Object reference not set to an instance of an object. The only modification I did to the code was to set the connection string for my device on the form: "HostName=<iothub_host_name>;DeviceId=<device_id>;SharedAccessKey=<device_key>" using my real connection string for the device of course. I'm using v1.2.2 of the Microsoft.Azure.Devices.Client |
Fix provided in 1.2.3. Please let us know if still having issue. |
Using master from https://github.com/Azure/azure-iot-sdk-csharp.git, the callback function is not getting called when the Device Twin desired properties change.
Here's the WPF application code I have tested with:
public partial class MainWindow : Window
{
private const string DeviceConnectionString = "";
private DeviceClient _deviceClient;
The text was updated successfully, but these errors were encountered: