-
Notifications
You must be signed in to change notification settings - Fork 168
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
Bad design of StateTree.collectDirtyNodes() #317
Comments
Notes for myself:
|
denis-anisimov
pushed a commit
that referenced
this issue
Oct 4, 2019
In the PR :
So I've just added warnings to avoid calling this methods from unexpected places. |
denis-anisimov
pushed a commit
that referenced
this issue
Oct 4, 2019
ujoni
pushed a commit
that referenced
this issue
Oct 11, 2019
ujoni
pushed a commit
that referenced
this issue
Oct 11, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
com.vaadin.flow.internal.StateTree.collectDirtyNodes()
is a public method which mutates the internal state.The method cleans up dirty nodes list.
User may call it at any time so it will break the logic which relies on this list to collect changes.
Actually collectChanges() method delegates the call to collectDirtyNodes() snd also causes the same issue.
The dirty nodes list should be cleaned up once (in the end of request handling ?) instead of cleaning up each time when changes are collected (f.e. as a reaction on event). And this logic should not be exposed as API.
The text was updated successfully, but these errors were encountered: