Event Constructor Logic Not Being Invoked on Object Instantiation #1462
Labels
bug
Something isn't working
dev-experience
Developer Experience
difficulty: medium
package:core
Affects the core package
priority: low
size: M
Tasks where you have to change some files.
Bug Report
Current Behavior
When implementing logic within the constructor of an event in the Booster Framework, the constructor code is not being invoked as expected. The constructor logic has to be moved to a static method which is then explicitly called to ensure proper execution.
Expected behavior
It is expected that the constructor code within an event should be invoked properly, ensuring that any logic within the constructor executes as intended without the need to relocate the logic to a static method.
Possible Solution
It appears that the issue might be stemming from how the event dispatcher is handling object instantiation -- specifically, passing plain JSON received from the DB and instructing TypeScript to treat it as a class instance. A potential solution could involve revising the instantiation process to ensure that constructors are called and executed properly.
Additional information
Environment
Comments
This issue was brought to attention by users experiencing unpredictable behavior due to constructor logic not executing. An investigation into the event dispatcher's object instantiation process might provide insight into resolving this bug.
The text was updated successfully, but these errors were encountered: