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

Return back preventing disallowed property update #4774

Merged
merged 10 commits into from
Nov 14, 2018

Conversation

denis-anisimov
Copy link
Contributor

@denis-anisimov denis-anisimov commented Nov 12, 2018

This change is Reviewable

@denis-anisimov denis-anisimov changed the title Return back preventing disallowed property update WIP: Return back preventing disallowed property update Nov 12, 2018
(ListModelType<?>) propertyType);
}
if (beanType != null) {
((BeanModelType<?>) beanType).collectAllowedProperties(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Remove this unnecessary cast to "BeanModelType". rule

return updateFromClientFilter.test(key);
} else {
return false;
private AllowUpdate isUpdateFromClientAllowedByFilter(StateNode node,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Refactor this method to reduce its Cognitive Complexity from 17 to the 15 allowed. rule

@denis-anisimov denis-anisimov changed the title WIP: Return back preventing disallowed property update Return back preventing disallowed property update Nov 13, 2018
Copy link
Contributor

@caalador caalador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 4 files at r1, 2 of 2 files at r3, 5 of 5 files at r4.
Reviewable status: 3 unresolved discussions, 0 of 1 LGTMs obtained


flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementPropertyMap.java, line 298 at r4 (raw file):

        }
        return AllowUpdate.NO_EXPLICIT_STATUS;
    }

Seems right, but would benefit from having a flowchart as this is really hard to follow when it goes through the same methods multiple times. As at first the new rounds seem unnecessary.

Perhaps clarify the flow for deferredUpdateFromClient.
Add the flowchart to comment or as it's own page to the wiki.


flow-server/src/main/java/com/vaadin/flow/templatemodel/BeanModelType.java, line 682 at r4 (raw file):

((ListModelType<?>) type)

Un needed cast as we only take in ListModelType<?>

Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 3 unresolved discussions, 0 of 1 LGTMs obtained


flow-server/src/main/java/com/vaadin/flow/templatemodel/BeanModelType.java, line 682 at r4 (raw file):

Previously, caalador wrote…
((ListModelType<?>) type)

Un needed cast as we only take in ListModelType<?>

Right, leftover from refactoring.

Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 3 unresolved discussions, 0 of 1 LGTMs obtained


flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementPropertyMap.java, line 298 at r4 (raw file):

Previously, caalador wrote…

Seems right, but would benefit from having a flowchart as this is really hard to follow when it goes through the same methods multiple times. As at first the new rounds seem unnecessary.

Perhaps clarify the flow for deferredUpdateFromClient.
Add the flowchart to comment or as it's own page to the wiki.

I agree that this is complicated logic.
I've extracted private methods and added comments with ascii chart.

Copy link
Contributor

@caalador caalador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r5.
Reviewable status: 3 unresolved discussions, 1 of 1 LGTMs obtained


flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementPropertyMap.java, line 298 at r4 (raw file):

Previously, denis-anisimov (Denis) wrote…

I agree that this is complicated logic.
I've extracted private methods and added comments with ascii chart.

Nice.

return allowUpdateFromClient(key, value);
}

private boolean allowUpdateFromClient(String key, Serializable value) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Remove this unused method parameter "value". rule

*
* Here is the logic flow:
*
* <pre>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL Javadoc comment at column 8 has parse error. Missed HTML close tag 'pre'. Sometimes it means that close tag missed for one of previous tags. rule

@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 4 issues

  • CRITICAL 1 critical
  • MAJOR 2 major
  • MINOR 1 minor

Watch the comments in this conversation to review them.

Copy link
Contributor Author

@denis-anisimov denis-anisimov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dismissed @vaadin-bot from 4 discussions.
Reviewable status: :shipit: complete! all discussions resolved, 1 of 1 LGTMs obtained

@denis-anisimov denis-anisimov merged commit d58da92 into master Nov 14, 2018
@denis-anisimov denis-anisimov deleted the disallow-client-update branch November 14, 2018 10:59
denis-anisimov pushed a commit that referenced this pull request Nov 14, 2018
# Conflicts:
#	flow-server/src/main/java/com/vaadin/flow/internal/nodefeature/ElementPropertyMap.java
@denis-anisimov denis-anisimov added this to the 1.3.0.alpha1 milestone Dec 17, 2018
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.

3 participants