Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

[#6771] Fix Attachment issue when it has a MemoryStream instance - #6850

#6850
Merged
tracyboehrer merged 2 commits into
mainmicrosoft/botbuilder-dotnet:mainfrom
southworks/fix/attachment-memorystreammicrosoft/botbuilder-dotnet:southworks/fix/attachment-memorystreamCopy head branch name to clipboard
Sep 17, 2024
Merged

[#6771] Fix Attachment issue when it has a MemoryStream instance#6850
tracyboehrer merged 2 commits into
mainmicrosoft/botbuilder-dotnet:mainfrom
southworks/fix/attachment-memorystreammicrosoft/botbuilder-dotnet:southworks/fix/attachment-memorystreamCopy head branch name to clipboard

Conversation

@sw-joelmut

Copy link
Copy Markdown
Collaborator

Fixes #6771

Description

This PR fixes an issue with DLASE when a MemoryStream instance is being used as an Activity.Attachment, e.g. a file. The ReadTimeout issue is caused when trying to serialize the non-serializable MemoryStream instance.

Specific Changes

  • Adds the AttachmentMemoryStreamConverter to serialize and deserialize a MemoryStream instance.
    • Serialize (WriteJson): It recursively searches and replaces all instances of MemoryStream to a serializable class, containing a type and a buffer array.
    • Deserialize (ReadJson): It recursivelly searches and converts all objects of type MemoryStream to a MemoryStream instance with the buffer array.
  • Adds unit tests to cover cases previous to the JsonConverter addition, and using the JsonConverter.

Testing

The following images show the bot working, and the unit tests passing.
image
image

@sw-joelmut
sw-joelmut requested a review from a team as a code owner September 17, 2024 17:36
@sw-joelmut sw-joelmut added the Automation: No parity PR does not need to be applied to other languages. label Sep 17, 2024
@sw-joelmut

Copy link
Copy Markdown
Collaborator Author

Im looking at the failing tests

@BruceHaley

Copy link
Copy Markdown
Contributor

✔️ No Binary Compatibility issues for Microsoft.Bot.Schema.dll

@tracyboehrer
tracyboehrer merged commit c11b7fd into main Sep 17, 2024
@tracyboehrer
tracyboehrer deleted the southworks/fix/attachment-memorystream branch September 17, 2024 21:17
tracyboehrer pushed a commit that referenced this pull request Sep 19, 2024
* Fix Attachment issue when it has a MemoryStream instance

* Fix unit tests
This was referenced May 14, 2026
This was referenced May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Automation: No parity PR does not need to be applied to other languages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File Attachment gives error in private endpoint enabled bot

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.