Initializing a new ADT instance using SetupBuildingScenario can sometimes fail because of the eventual consistency in the backing datastore.
I tried a few times today and saw different errors at different points:
sometimes, it claims that fields on the twin are not valid according to the model, despite the model having them (it seems the model was created, but not yet made available by backend yet so it thought the fields didn't exist)
other times, the initial twin creation was successful but creating the relationships failed, claiming the twins did not exist yet (despite just having been created).
In either case, if I captured the net-traces using tools like mitmproxy, re-running the same REST call a few seconds later worked.
I suggest the sample introduce small delays between model creation, twin creation, and relationship creation to avoid this.
Initializing a new ADT instance using
SetupBuildingScenario
can sometimes fail because of the eventual consistency in the backing datastore.I tried a few times today and saw different errors at different points:
In either case, if I captured the net-traces using tools like
mitmproxy
, re-running the same REST call a few seconds later worked.I suggest the sample introduce small delays between model creation, twin creation, and relationship creation to avoid this.