Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached lgm initialization in lg extension #2989

Merged
merged 2 commits into from
Nov 2, 2020
Merged

Cached lgm initialization in lg extension #2989

merged 2 commits into from
Nov 2, 2020

Conversation

chon219
Copy link
Member

@chon219 chon219 commented Nov 2, 2020

Fixes #2988

Description

Cached instances of LanguageGeneratorManager in LanguageGeneratorExtensions to avoid registering duplicated callbacks in resource explorer.

Specific Changes

  • Cached lgm instance in LanguageGeneratorExtensions.useLanguageGenerator().

Testing

@chon219 chon219 added the Area: Adaptive The issue is related to Adaptive dialogs label Nov 2, 2020
@chon219 chon219 requested a review from a team as a code owner November 2, 2020 09:00
@chon219 chon219 self-assigned this Nov 2, 2020
@chon219 chon219 requested review from Stevenic and luhan2017 November 2, 2020 09:00
Copy link
Contributor

@joshgummersall joshgummersall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small fixes, otherwise it looks good!

@chon219 chon219 merged commit 7f23545 into main Nov 2, 2020
@chon219 chon219 deleted the zim/fix-lgm branch November 2, 2020 17:04
@chon219
Copy link
Member Author

chon219 commented Nov 3, 2020

@joshgummersall Caching lgm in a map may cause GC issues, check out this issue: microsoft/botbuilder-dotnet#4871
Shall we use WeakMap instead of Map to fix this?

@joshgummersall
Copy link
Contributor

I think a Weakmap would work for this use case as long as all the targets for this library support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Adaptive The issue is related to Adaptive dialogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource Explorer registered duplicated LG resource listener
2 participants