microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.6k stars 1.55k forks source link

fix: scope use-propagate to a single Web Chat instance #5248

Closed OEvgeny closed 3 months ago

OEvgeny commented 3 months ago

Related to #5150.

Fixes #

Changelog Entry

Description

This PR addresses an issue where multiple Web Chat instances on the same page could interfere with each other due to shared use-propagate hook listeners. By introducing scopes for these hooks, we ensure that each Web Chat instance operates independently.

Design

This design decision encapsulates the scoping logic within the Web Chat's core structure, providing isolation for multiple instances while keeping the public API unchanged. The scopes were added to the ComposerCoreUI component specifically, as they are UI-related.

This placement allows the Composer component to be used as before without exposing scope components, maintaining backwards compatibility. We don't expose the scope components externally due to the lack of current use cases.

Specific Changes

-

-

Review Checklist

This section is for contributors to review your work.