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

Event Constructor Logic Not Being Invoked on Object Instantiation #1462

Open
javiertoledo opened this issue Oct 9, 2023 · 0 comments
Open
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.

Comments

@javiertoledo
Copy link
Member

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

  • Booster version: 1.19.0
  • Node/npm version: node 16
  • OS: OSX

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.

@javiertoledo javiertoledo added bug Something isn't working size: M Tasks where you have to change some files. package:core Affects the core package dev-experience Developer Experience difficulty: medium priority: low labels Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
Status: No status
Development

No branches or pull requests

1 participant