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

Ensure Assign() copies components before notifying listeners #426

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

g-getsov
Copy link
Contributor

@g-getsov g-getsov commented Sep 3, 2024

When calling Assign(), listeners get notified of a ComponentAdded event after the exchange() happens but before the component gets copied. This means that if that component gets fetched in the listener it will be a "zero" component.

The changes in this PR ensure that components are copied before notifying listeners. It splits the internal exchange() function into exchange(), exchangeNoNotify() and notifyExchange(). This allows us to perform the copyTo() in the Assign() before notifying the listeners.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 10682540960

Details

  • 36 of 36 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 10613042955: 0.0%
Covered Lines: 6385
Relevant Lines: 6385

💛 - Coveralls

@mlange-42
Copy link
Owner

Nice! Thanks for spotting and fixing this. Just let me read the diff carefully...

@mlange-42 mlange-42 merged commit e3b0bd4 into mlange-42:main Sep 4, 2024
18 checks passed
@g-getsov g-getsov deleted the fix_assign_copy_before_notify branch September 4, 2024 18:26
@mlange-42 mlange-42 added the bug Something isn't working label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants