-
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
Avoid state mutation in a public method, add a warning #6618
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1.
Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @denis-anisimov)
flow-server/src/main/java/com/vaadin/flow/internal/StateTree.java, line 421 at r1 (raw file):
private Set<StateNode> doCollectDirtyNodes(boolean reset) { Set<StateNode> collectedNodes = dirtyNodes; dirtyNodes = new LinkedHashSet<>();
Dirty nodes is reset every time and never checks the flag.
Also on false the state should be returned as a copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r1.
Reviewable status: 1 unresolved discussion, 0 of 1 LGTMs obtained (waiting on @caalador)
flow-server/src/main/java/com/vaadin/flow/internal/StateTree.java, line 421 at r1 (raw file):
Previously, caalador wrote…
Dirty nodes is reset every time and never checks the flag.
Also on false the state should be returned as a copy.
Right, forgot to do everything.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r2, 1 of 1 files at r3.
Reviewable status: complete! all discussions resolved, 1 of 1 LGTMs obtained
Fixes #317
This change is