This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[botbuilder] TeamsActivityHandler — Prevent calling event handlers twice
Fixes microsoft#4202 Description This change prevents calling TeamsActivityHandler event handlers twice for every event received. Specific Changes Why were the event handlers getting called twice? - teamsActivityHandler overwrites `dispatchEventActivity` - `dispatchEventActivity` is only called from within `onEventActivity` - `onEventActivity` already dispatches *after* calling all handlers - on teamsActivityHandler, when overwriting, it is also calling all handlers How to fix it? - Prevent the handler call inside the dispatchEventHandler - This should have no effect on any consumer, since they should already be consuming only from within a onEventActivity call. Testing A test is added to prevent the behavior from reappearing Note that to test the issue described, it is enough to run the changed test in main. The test will fail when run in main currently, since since it is called twice.
- Loading branch information