Ensure event modules are loaded during deserialization #2020
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Ensure the event module is loaded during deserialization, otherwise
function_exported?
doesn't return the expected response, as this function doesn't load the modules.Without, this the upcasting and superseding of the modules wasn't happening with legacy events, which were not being loaded in some cases, I guess because they are not used anywhere during compilation (my guess).
Some refs:
elixir-lang/elixir#11524
https://hexdocs.pm/elixir/Kernel.html#function_exported?/3
https://hexdocs.pm/elixir/Code.html#ensure_loaded?/1
How was this tested?
Tested manually. As discussed with @CDimonaco , we need some integration test to check if the migration doesn't fail.