View Issue Details

IDProjectCategoryView StatusLast Update
0012991mantisbtapi soappublic2013-04-06 08:22
Reporterrombert Assigned Torombert  
PriorityhighSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version1.2.6Fixed in Version1.2.6 
Summary0012991: mc_filter_get_issues returns incorrect results for page_number > page_count
Description

(Stemming from a discussion at http://jira.codehaus.org/browse/SONARPLUGINS-1163 )

The filter API assumes that if the requested page number is larger than the last page number, the request page number becomes the last page number. This means that if I request page 4 for a filter which has 2 pages, I will get the second page.

For the SOAP API this means that if a filter returns a number of issues which divides with the request issues per page, the last page will forever loop at the maximum number of rows. E.g.:

  • filter returns 400 issues
  • rows per page is set to 100
  • client verifies if the number of rows is < 100 to break the invocation

When page 0000004 is requested, there will be 100 issues. When page 0000005 -> infinity are requested, those same issues will be returned, and the client will never break out of the loop. The SOAP API code needs to be adjusted to return zero, rather than the last page's issues when the page number is out of bounds.

TagsNo tags attached.
Attached Files

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

jer

jer

2011-05-11 14:48

reporter   ~0028770

Last edited: 2011-05-11 14:51

I also discovered this scenario.
If you have 300 issues (100 per page)
the first page containq issue 1 to 100,
second page 101 to 200
third page 201 to 300
fourth page 201 to 300 (and not 0 issue)
fifth page 201 to 300 (and not 0 issue)
.... so on in infinite loop.

Is it possible to retrieve the number of pages available?

rombert

rombert

2011-05-11 15:08

reporter   ~0028771

It's not possible right now to retrieve the number of pages, but there is a feature request for that ( bug 0008656 ). Unfortunately it needs a breaking change to the WSDL to be done right so it's likely going to be 1.3.x only.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036437

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

Related Changesets

MantisBT: master 7b763277

2011-05-19 17:19

rombert


Details Diff
SOAP API: Return an empty result when the page is outside the filter

Rather than return the last page when an out of bounds page is
requested, return no issues. This allows clients to find out when
there are no more issues for a specific filter.

Fixes 0012991 : mc_filter_get_issues returns incorrect results for page_number > page_count
Affected Issues
0012991
mod - api/soap/mc_filter_api.php Diff File
mod - tests/soap/FilterTest.php Diff File
mod - api/soap/mc_project_api.php Diff File

MantisBT: master-1.2.x c70ff523

2011-05-19 17:19

rombert


Details Diff
SOAP API: Return an empty result when the page is outside the filter

Rather than return the last page when an out of bounds page is
requested, return no issues. This allows clients to find out when
there are no more issues for a specific filter.

Fixes 0012991 : mc_filter_get_issues returns incorrect results for page_number > page_count
Affected Issues
0012991
mod - tests/soap/FilterTest.php Diff File
mod - api/soap/mc_project_api.php Diff File
mod - api/soap/mc_filter_api.php Diff File