BlobStorage is not tracking changes in state causing outdated state to be saved #6584
Labels
Bot Services
Required for internal Azure reporting. Do not delete. Do not change color.
bug
Indicates an unexpected problem or an unintended behavior.
customer-replied-to
Indicates that the team has replied to the issue reported by the customer. Do not delete.
customer-reported
Issue is created by anyone that is not a collaborator in the repository.
Version
4.19.1
Describe the bug
Looking at the documentation and samples, the way to update state is:
Example code in the StateManagementBot
When doing so with MemoryStorage, everything works as expected.
When using Blob Storage, the initial state is written to the storage.
However when retrieving the object and updating it, on
SaveChangesAsync
the updated object is not correctly written.Even when using the
force:true
the state is updated, but with the original version of the object, instead of the updated object.To Reproduce
Steps to reproduce the behavior:
Startup
your storage to use blob storageservices.AddSingleton<IStorage>(new BlobsStorage(dataConnectionString, "bot-state"));
services.AddSingleton<ConversationState>();
OnTurnAsync
create property and retrieve conversation stateExpected behavior
State in blob container should reflect changes done to the object, holding "LastStep".
Additional context
While using the force parameter, doesn't solve the issue. Using
SetAsync
does provide a workaroundawait conversationDataAccessor.SetAsync(turnContext, conversationData, cancellationToken);
The text was updated successfully, but these errors were encountered: