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

Conversation

@sw-joelmut
Copy link
Collaborator

#minor

Description

This PR replaces the skipProperties functionality with an internal _replacer function when the JSON.stringify function gets called in the calculateChangeHash.
The calculateChangeHash has been changed to use a new internal stringify function, that allows to detect and handle Circular Structures.
Additionally, the AgentSettings configuration has being added to the getRuntimeServices function, so internal functionalities can use them. Not only that, the SkillClient has being updated based on this configuration, that work for both Composer and non-Composer bots.

Specific Changes

  • The BotState class has being updated, removing all the skipProperties functionality.
  • The calculateChangeHash has being refactored to handle Circular Structures and generate a hash, instead of a plain JSON.stringify value, so it is easier to debug and identify.
  • Added the ConnectorClientOptions to the start and getRuntimeServices functions for Composer bots, so it can be customizable, and delegate to the internal CoreBot to use.
  • The BeginSkill has being updated, removing the skipProperties and introducing the new internal _replace function, for the stringify functionality to execute.
  • Added a new stringify function that encapsulates the native JSON.stringify function, with the addition to handle Circular Structures and expose the internal _replacer function to customize it.
  • Updated the internal botFrameworkClientFetchImpl function to use a single instance of axios and handle its configuration from ConnectorClientOptions.

Testing

The following images show how the ConnectorClientOptions can be provided from a Composer bot perspective, the new stringify functionality that detects and replaces circular references, and the generated hash string.
image
image
image

@sw-joelmut sw-joelmut requested a review from a team as a code owner April 3, 2024 18:17
@coveralls
Copy link

coveralls commented Apr 4, 2024

Pull Request Test Coverage Report for Build 8543859968

Details

  • 40 of 56 (71.43%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 84.427%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder-stdlib/src/stringify.ts 24 25 96.0%
libraries/botframework-connector/src/auth/botFrameworkClientImpl.ts 2 17 11.76%
Totals Coverage Status
Change from base Build 8543007355: 0.3%
Covered Lines: 20419
Relevant Lines: 22894

💛 - Coveralls

@tracyboehrer tracyboehrer merged commit d97afc2 into main Apr 16, 2024
@tracyboehrer tracyboehrer deleted the southworks/fix/circular-structure-expose-agent branch April 16, 2024 13:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants