carloea2 commented on code in PR #8146:
URL: https://github.com/apache/texera/pull/8146#discussion_r3897048943
##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/DashboardResource.scala:
##########
@@ -91,6 +91,8 @@ object DashboardResource {
@BeanParam params: SearchQueryParams,
includePublic: Boolean = false
): DashboardSearchResult = {
+ if (params.offset < 0 || params.count < 0)
+ throw new BadRequestException("start and count must be non-negative")
Review Comment:
Added an Int.MaxValue guard before limit and a regression for the overflow
case.
##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/DashboardResourceSpec.scala:
##########
@@ -123,7 +132,15 @@ class DashboardResourceSpec extends AnyFlatSpec with
Matchers {
// -- searchAllResources: the dispatch guard --------------------------------
- "searchAllResources" should "reject an unknown resourceType before it builds
any query" in {
+ "searchAllResources" should "reject a negative start" in {
Review Comment:
Added the zero pagination boundary case.
##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/DashboardResourceSpec.scala:
##########
@@ -123,7 +132,15 @@ class DashboardResourceSpec extends AnyFlatSpec with
Matchers {
// -- searchAllResources: the dispatch guard --------------------------------
- "searchAllResources" should "reject an unknown resourceType before it builds
any query" in {
+ "searchAllResources" should "reject a negative start" in {
Review Comment:
Updated the spec description and section heading to include pagination.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]