This repository was archived by the owner on Jan 5, 2026. It is now read-only.
[#6582, #6584] Incorrect serialization of state when using Blob or CosmosDB storage in v4.19.x - #6585
Merged
Merged
Conversation
Collaborator
Pull Request Test Coverage Report for Build 339272
💛 - Coveralls |
Contributor
|
✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.dll |
tracyboehrer
approved these changes
Feb 13, 2023
tracyboehrer
pushed a commit
that referenced
this pull request
Feb 13, 2023
…smosDB storage in v4.19.x (#6585) * Refactor AllowedTypesSerializationBinder to dynamically load types * Update AllowedTypesSerializationBinder tests
tracyboehrer
added a commit
that referenced
this pull request
Feb 23, 2023
* Revert "[#6582, #6584] Incorrect serialization of state when using Blob or CosmosDB storage in v4.19.x (#6585)" This reverts commit e15b38d. * Revert "Fix CodeQL SM02211 alert - SerializationBinder (#6549)" This reverts commit 1ee5f6a. * Skip TypeNameHandling CodeQL issue from Azure and Blobs storage (#6592) --------- Co-authored-by: Tracy Boehrer <trboehre@microsoft.com> Co-authored-by: Joel Mut <62260472+sw-joelmut@users.noreply.github.com>
This was referenced May 14, 2026
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6582
Fixes #6584
Description
This PR refactors the

AllowedTypesSerializationBinderclass to allow custom types to be loaded dynamically, this includes types from BotBuilder and the project who is using it (e.g. a bot sample).Also, the process verifies the serialized and deserialized types are allowed or valid, otherwise it will fail with the following message sample:
Specific Changes
LoadTypesmethod to dynamically load types from external projects (e.g. a bot sample), internal libraries (BotBuilder, with its nested related types).Verifymethod, that validates after serializing and deserializing an object, it has all valid or allowed types, otherwise it will fail.CleanupTypesmethod, since all types are now saved equally into the Storage, and validated when read or write.Testing
The following image shows the changes working with Blobs Storage and CosmosDB.
