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

EmailPlugin - Handler: loadData() function gets called on all event emissions #518

Closed
chladog opened this issue Oct 20, 2020 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@chladog
Copy link
Contributor

chladog commented Oct 20, 2020

Describe the bug
loadData() of EmailHandler is being called for every emission of event (e.g. OrderStateTransition), not just when it passes the filter() resulting all queries in loadData being run on any order transition.

To Reproduce
Steps to reproduce the behavior:
-find any EmailHandler definition that listen to .on(OrderStateTransition)
-set filter(x => false) so it would never pass
-insert console.log('Hello World'); to its loadData function
-transition any order to any state
-check the spam in the console

Expected behavior
loadData function should be invoked only for transition that pass the filter() function in EmailHandler

Environment (please complete the following information):

  • @vendure/core version: v16.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants