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

Remove checks for invalid handlers #4

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

tanyakavrakova
Copy link
Contributor

@tanyakavrakova tanyakavrakova commented Sep 11, 2023

Remove conditions that check if handlers are valid handlers for an event.

validate_handlers/2 first checks if __handled_events__ function is defined in each of the handlers and then checks if all handlers handle the event.
However, at the time of checking if __handled_events__ function is defined, the handler module may not be loaded. This will cause the function validate_handlers/2 to return incorrect falsy result.

Since the checks that validate handlers happen at run-time, this does not provide much more value compared to just letting it crash. That is why validate_handlers/2 function is entirely removed from the code.

@tanyakavrakova tanyakavrakova force-pushed the chore/remove-check-invalid-handlers branch from 3dee356 to eb986ee Compare September 11, 2023 15:01
@tanyakavrakova tanyakavrakova changed the title Remove check for invalid handlers Remove checks for invalid handlers Sep 11, 2023
@tanyakavrakova tanyakavrakova merged commit d7650f7 into main Sep 11, 2023
2 checks passed
@tanyakavrakova tanyakavrakova deleted the chore/remove-check-invalid-handlers branch September 11, 2023 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants