microsoft / botbuilder-js

Welcome to the Bot Framework SDK for JavaScript repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using JavaScript.
https://github.com/Microsoft/botframework
MIT License
683 stars 279 forks source link

refactor: AgentSettings Circular Structure and improve internals #4641

Closed sw-joelmut closed 6 months ago

sw-joelmut commented 7 months ago

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

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

coveralls commented 7 months ago

Pull Request Test Coverage Report for Build 8543859968

Details


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%
<!-- Total: 40 56 71.43% -->
Totals Coverage Status
Change from base Build 8543007355: 0.3%
Covered Lines: 20419
Relevant Lines: 22894

💛 - Coveralls