Skip to content

[BUG] BasicDigitalTwin is not always populated  #23073

Closed

Description

Describe the bug
If I make two calls:

AsyncPageable playerCardTwinList = dtclient.QueryAsync($"SELECT * FROM DIGITALTWINS WHERE Value = '{pcard.Value}' and Suite = '{pcard.Suite}

and

AsyncPageable playerCardTwinList = dtclient.QueryAsync($"SELECT D FROM DIGITALTWINS D WHERE D.Value = '{pcard.Value}' and D.Suite = '{pcard.Suite}

And then I use foreach to get the returned single digital twin, I should get the same resulting BasicDigitalTwin object. The queries do produce the same results, however in the SDK, the first works correctly, but in the second, the object is not filled in. The information is in a string in the contents field, the ID is null. It is not directly usable. The contents string looks like this:

ValueKind = Object : "{"$dtId":"31","$etag":"W/\u0022f2425136-3329-46bc-a4a6-8a17a0ec8400\u0022","Value":"King","NumericalValue":10,"Suite":"Club","Color":"Black","$metadata":{"$model":"dtmi:games:Card;1","Value":{"lastUpdateTime":"2021-08-03T15:19:17.4469582Z"},"NumericalValue":{"lastUpdateTime":"2021-08-03T15:19:17.4469582Z"},"Suite":{"lastUpdateTime":"2021-08-03T15:19:17.4469582Z"},"Color":{"lastUpdateTime":"2021-08-03T15:19:17.4469582Z"}}}"

Expected behavior
What is the expected behavior?
For both cases, the BasicDigitalTwin object should be filled in. ID should have the $dtId, Contents should contain an array of properties that were on the twin. I should not have to parse json in the second example to get the ID and other properties.

Actual behavior (include Exception or Stack Trace)
What is the actual behavior?
See above. The BasicDigitalTwin object should be fully filled in, identically, in both cases.

To Reproduce
Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

  1. Make a call similar to the above

Environment:

  • Name and version of the Library package used: [e.g. Azure.Storage.Blobs 12.2.0]
  • Hosting platform or OS and .NET runtime version (dotnet --info output for .NET Core projects): [e.g. Azure AppService or Windows 10 .NET Framework 4.8]
  • IDE and version : [e.g. Visual Studio 16.3]

.Net Core 3.1
Visual Studio 16.10.4
Azure.DigitalTwins.Core 1.2.2
Microsoft.Net.SDK.Functions 3.0.13
Note that although this is function code, I see the behavior when running in debug in visual studio

PS C:\Users\pfisher> dotnet --info
.NET SDK (reflecting any global.json):
Version: 5.0.302
Commit: c005824e35

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.302\

Host (useful for support):
Version: 5.0.8
Commit: 35964c9215

.NET SDKs installed:
3.1.411 [C:\Program Files\dotnet\sdk]
5.0.205 [C:\Program Files\dotnet\sdk]
5.0.302 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Digital TwinsService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions