Skip to content

[#6885] Fix MemoryStream Converter when serializing #6888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

sw-joelmut
Copy link
Collaborator

Fixes #6885

Description

This Pr fixes an issue when adding and removing the converter to the JsonSerializer over multiple threads, causing fail due to null assignment.

Specific Changes

  • Replaced WriteJson functionality from assigning the converter recursively to instead call the WriteJson recursively to serialize the object.
  • Updated HaveStreams method to work with both Read and Write json.
  • WriteJson and HaveStreams methods now share similar behavior, detecting Dictionaries, Collections, and Classes separately.

Testing

The following image shows the unit tests continue working correctly.
imagen

@sw-joelmut sw-joelmut requested a review from tracyboehrer April 1, 2025 13:11
@tracyboehrer tracyboehrer merged commit 8e47775 into main May 28, 2025
2 checks passed
@tracyboehrer tracyboehrer deleted the southworks/fix/memory-stream-converter branch May 28, 2025 21:45
tracyboehrer added a commit that referenced this pull request May 29, 2025
* Add support for .NET 9.0 (#6887)

* Add NET9 and remove NET6 target frameworks

* Configure NETAnalyzers version in Directory.Build.props

* Update yamls to support NET 9.0

* Update tests to pass on Mac build.

* [#6889] CQA to support TokenCredential instead of key (#6892)

* Add support for MSI to access CQA service

* Use IsNullOrWhiteSpace instead of IsNullOrEmpty

* Catch exception in GetTokenAsync call

* Fix MemoryStream Converter when serializing (#6888)

---------

Co-authored-by: Cecilia Avila <[email protected]>
Co-authored-by: Joel Mut <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#6850 Causes Null Reference Exception If Attachment Content Gets Into BotState
2 participants