-
Notifications
You must be signed in to change notification settings - Fork 70
fix: throw error if requested page or item count exceeds the Flow limit #3798
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: throw error if requested page or item count exceeds the Flow limit #3798
Conversation
...flow-parent/vaadin-grid-flow/src/main/resources/META-INF/resources/frontend/gridConnector.js
Outdated
Show resolved
Hide resolved
...flow-parent/vaadin-grid-flow/src/main/resources/META-INF/resources/frontend/gridConnector.js
Outdated
Show resolved
Hide resolved
...flow-parent/vaadin-grid-flow/src/main/resources/META-INF/resources/frontend/gridConnector.js
Outdated
Show resolved
Hide resolved
… the connector Correct length check, add isAllRowsVisible check, carry the code to the server side.
vaadin-grid-flow-parent/vaadin-grid-flow/src/main/java/com/vaadin/flow/component/grid/Grid.java
Show resolved
Hide resolved
vaadin-grid-flow-parent/vaadin-grid-flow/src/main/java/com/vaadin/flow/component/grid/Grid.java
Outdated
Show resolved
Hide resolved
SonarCloud Quality Gate failed.
|
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.
LGTM
Should be merged after the Flow vaadin/flow#14630 is merged.
I think this change would already provide value for users, even before the DataProvider issue in Flow is fixed.
| IllegalAccessException | IllegalArgumentException | ||
| InvocationTargetException e) { | ||
if (e.getCause() instanceof IllegalArgumentException) { | ||
throw (IllegalArgumentException) e.getCause(); |
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.
Did I read it correctly that this just re-throws IllegalArgumentException
? Could it be then excluded from the union of exceptions above?
if (e.getCause() instanceof IllegalArgumentException) { | ||
throw (IllegalArgumentException) e.getCause(); | ||
} | ||
Assert.fail("Could not call Grid.setRequestedRange"); |
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.
I guess it would be helpful to know the cause of the failure here. Could we simply not handle these exceptions like here? Does that approach have any negative consequences?
…ter-10-x-pagesize-items
…ter-10-x-pagesize-items
SonarCloud Quality Gate failed.
|
…it (#3798) * fix: throw error if requested page or item count exceeds the Flow limit * fix: correct the if clause and check it in the server side instead of the connector Correct length check, add isAllRowsVisible check, carry the code to the server side. * fix: change the exception message * test: add tests for request variations
…it (#3798) * fix: throw error if requested page or item count exceeds the Flow limit * fix: correct the if clause and check it in the server side instead of the connector Correct length check, add isAllRowsVisible check, carry the code to the server side. * fix: change the exception message * test: add tests for request variations
…it (#3798) * fix: throw error if requested page or item count exceeds the Flow limit * fix: correct the if clause and check it in the server side instead of the connector Correct length check, add isAllRowsVisible check, carry the code to the server side. * fix: change the exception message * test: add tests for request variations
…it (#3798) * fix: throw error if requested page or item count exceeds the Flow limit * fix: correct the if clause and check it in the server side instead of the connector Correct length check, add isAllRowsVisible check, carry the code to the server side. * fix: change the exception message * test: add tests for request variations
…it (#3798) (#4171) * fix: throw error if requested page or item count exceeds the Flow limit * fix: correct the if clause and check it in the server side instead of the connector Correct length check, add isAllRowsVisible check, carry the code to the server side. * fix: change the exception message * test: add tests for request variations Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
…it (#3798) (#4172) * fix: throw error if requested page or item count exceeds the Flow limit * fix: correct the if clause and check it in the server side instead of the connector Correct length check, add isAllRowsVisible check, carry the code to the server side. * fix: change the exception message * test: add tests for request variations Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
…it (#3798) (#4173) * fix: throw error if requested page or item count exceeds the Flow limit * fix: correct the if clause and check it in the server side instead of the connector Correct length check, add isAllRowsVisible check, carry the code to the server side. * fix: change the exception message * test: add tests for request variations Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
…it (#3798) (#4174) * fix: throw error if requested page or item count exceeds the Flow limit * fix: correct the if clause and check it in the server side instead of the connector Correct length check, add isAllRowsVisible check, carry the code to the server side. * fix: change the exception message * test: add tests for request variations Co-authored-by: Ugur Saglam <106508695+ugur-vaadin@users.noreply.github.com>
This ticket/PR has been released with Vaadin 24.0.0.alpha5 and is also targeting the upcoming stable 24.0.0 version. |
Description
A recent change in Flow has limited the number of pages in the response to 10. Also, there is an issue to add another constraint to the responses to have a maximum item count of 500. This PR ensures that these constraints are respected in the
Grid
. If more pages or items are requested from the, an exception will be thrown.Should be merged after the Flow issue is merged.
Fixes #3708
Type of change
Checklist