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

Incorrect this context for resolveConflict causing CRO to lose context to itself #242

Closed
cwkang1998 opened this issue Nov 7, 2024 · 1 comment

Comments

@cwkang1998
Copy link
Contributor

During runtime, when attempting to access CRO methods within the scope of resolveConflict, this loses its context and no longer refers to the implemented CRO but rather points to the hashgraph (i.e. this === HashGraph). This is caused by passing cro.resolveConflicts during the hash graph construction in the TopologyObject.

Fixing this is crucial to allow implementors of the CRO interface to access their implementation methods and states.

The problematic line of code is located here: https://github.com/topology-foundation/ts-topology/blob/cda5dd5300be6656f0b53738fa9e1c1054835d80/packages/object/src/index.ts#L59

@ghost ghost added this to DRP Nov 7, 2024
@github-project-automation github-project-automation bot moved this to Triage in DRP Nov 7, 2024
@d-roak
Copy link
Contributor

d-roak commented Nov 7, 2024

fixed with #243

@d-roak d-roak closed this as completed Nov 7, 2024
@github-project-automation github-project-automation bot moved this from Triage to 🏆 Done in DRP Nov 7, 2024
anhnd350309 added a commit that referenced this issue Jan 13, 2025
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

No branches or pull requests

2 participants