Azure / Azure/azure-iot-sdk-csharp
[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.
- Dominant language
- C#
- Stars
- 477
- Forks
- 492
- Avg merge
- 9h 55m
- Merged PRs (30d)
- 2
Description
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);
}
```
Contributor guide
Research direction
Reproduce the sequence using ModuleClient.UpdateReportedPropertiesAsync followed by ModuleClient.GetTwinAsync, and inspect the returned TwinCollection and service responses. Determine whether the stale value comes from the SDK or Azure IoT service behavior; done means the latest reported property is returned consistently, or the behavior is documented as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- api, cloud, embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100