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

[FIX] components: solve concurrency issue #1407

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

ged-odoo
Copy link
Contributor

No description provided.

@ged-odoo ged-odoo force-pushed the issue-concurrency-fix-ged branch 2 times, most recently from e9be6d2 to 0078d35 Compare April 17, 2023 08:31
Before this commit, in some specific situations, owl could skip updating
the DOM, even though it should. Here is what could happen:

- we have a parent component (A) and a child component (B)
- B depends on some reactive props from A
- we update some state that results in A being rendered, and B updated
- before this render is applied to the dom, we update some state again,
which causes A to be rendered again
- however, this new render is such that the B props are now identical,
so it will skip rendering B
- it will then apply the result of the render to the DOM => only A is
updated but B should also be updated!

The problem comes from the fact that Owl committed the props to the
component right after the rendering, to the new props were used in the
props comparison method to decide if B should be updated. This is
incorrect, we should always use the current props to decide what to do,
and only commit them to the component after it has been patched.
@sdegueldre sdegueldre merged commit 9a5ff7a into master Apr 17, 2023
@sdegueldre sdegueldre deleted the issue-concurrency-fix-ged branch April 17, 2023 09:06
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

Successfully merging this pull request may close these issues.

2 participants