Skip to content
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

[Bug Report] When try to fetch reported properties after updating the reported property it will return previous version of reported property not the latest one. #3437

Open
malavvvakharia opened this issue Feb 28, 2024 · 2 comments
Labels
bug Something isn't working.

Comments

@malavvvakharia
Copy link

malavvvakharia commented Feb 28, 2024

Steps:

  1. Try to update any key via ModuleClient.UpdateReportedPropertiesAsync method.
  2. Get the latest twin via ModuleClient.GetTwinAsync method.
  3. When you get the twin after updating then it contains the older version of reported properties.

Code:

public async Task UpdateReportedProperties(TwinCollection twinCollection)
    {
        _logger.Debug("Invoking UpdateReportedProperties");
      _logger.Debug("Module twin before updating : {ModuleTwin}", ModuleTwin);
        await _moduleClient.UpdateReportedPropertiesAsync(twinCollection);
          ModuleTwin = await _moduleClient!.GetTwinAsync();
       _logger.Debug("Module twin after updating : {ModuleTwin}", ModuleTwin);
   }
@malavvvakharia malavvvakharia added the bug Something isn't working. label Feb 28, 2024
@abhipsaMisra
Copy link
Member

Is this a leaf module (connected directly to IoT Hub) or an edge module (connected to IoT Hub via IoT Edge)?
(Edge modules don't always apply the patch immediately.)

@malavvvakharia
Copy link
Author

So, you mean that it will not work if it's an edge module? So, can I put a delay before fetching it like Task.Delay(10000) or any other solution do you have?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants