Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Fix error when building activity with non-string text - #6753

Merged
tracyboehrer (tracyboehrer) merged 2 commits into
mainfrom
southworks/fix/object-property-formatting
Mar 5, 2024
Merged

Fix error when building activity with non-string text#6753
tracyboehrer (tracyboehrer) merged 2 commits into
mainfrom
southworks/fix/object-property-formatting

Conversation

@ceciliaavila

Copy link
Copy Markdown
Collaborator

#minor
Related BF-Composer Issue: microsoft/BotFramework-Composer#9692

Description

This PR adds a validation to avoid sending object values as the activity's text and speak.
With this change, we are matching JS implementation.

Specific Changes

  • Added a validation for the text and speak properties in the BuildActivity method of the ActivityFactory class.
  • Added a unit test to cover this case in ActivityFactoryTests.
  • Added a new messageActivity template to use in the new test.

Testing

These images show how the property was displayed before and after the fix.
image

@ceciliaavila Cecilia Avila (ceciliaavila) added the Automation: No parity PR does not need to be applied to other languages. label Feb 22, 2024
@coveralls

Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 385156

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 15 unchanged lines in 2 files lost coverage.
  • Overall coverage remained the same at 78.391%

Files with Coverage Reduction New Missed Lines %
/libraries/Microsoft.Bot.Connector.Streaming/Session/StreamingSession.cs 3 90.09%
/libraries/Microsoft.Bot.Builder/ActivityFactory.cs 12 89.1%
Totals Coverage Status
Change from base Build 384727: 0.0%
Covered Lines: 26184
Relevant Lines: 33402

💛 - Coveralls

@BruceHaley

Copy link
Copy Markdown
Contributor

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

@tracyboehrer
tracyboehrer (tracyboehrer) deleted the southworks/fix/object-property-formatting branch March 5, 2024 15:07
tracyboehrer (tracyboehrer) pushed a commit that referenced this pull request Apr 15, 2024
* Format to string the text and speak properties

* Add unit test
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.

4 participants