Duplicates fetching - /api/v2/pages/{id}/descendant/page?limit=<n> - cursor repeats iteself

XMLWordPrintable

    • 7
    • Major
    • 7

      Issue Summary

      When fetching paginated results for the /api/v2/pages/{id}/descendants API, the API returns a duplicate cursor on subsequent requests, making it impossible to fetch all descendants.

      Steps to Reproduce

      • Have a page hierarchy with many descendants (I added 1000 to mine), but it can happen with less.
      • Make an API call to the descendants API
      curl -s -u ${username}:${unscoped} "${cloudHost}/wiki/api/v2/pages/4718593/descendants?depth=5&limit=50"|jq|grep -A1 links
        "_links": {
          "next": "/wiki/api/v2/pages/4718593/descendants?depth=5&limit=50&cursor=eyJpZCI6IjEwMzg3NDg3IiwicGF0aCI6WzI0MjgsMTYsMjE3NDVdfQ==", 
      • Get the result from the next line to make the next API call.

       
       

      curl -s -u ${username}:${unscoped} "${cloudHost}//wiki/api/v2/pages/4718593/descendants?depth=5&limit=50&cursor=eyJpZCI6IjEwMzg3NDg3IiwicGF0aCI6WzI0MjgsMTYsMjE3NDVdfQ=="|jq|grep -A1 links
        "_links": {
          "next": "/wiki/api/v2/pages/4718593/descendants?cursor=eyJpZCI6Ijk2NjY2NTEiLCJwYXRoIjpbMjQyOCwxNiw0NTMyNF19&depth=5&limit=50", 
      • Usually, on the third call, you’ll notice that the cursor returned for next is the same one that was used in the request

      {{}}

      curl -s -u ${username}:${unscoped} "${cloudHost}/wiki/api/v2/pages/4718593/descendants?cursor=eyJpZCI6Ijk2NjY2NTEiLCJwYXRoIjpbMjQyOCwxNiw0NTMyNF19&depth=5&limit=50"|jq|grep -A1 links
        "_links": {
          "next": "/wiki/api/v2/pages/4718593/descendants?cursor=eyJpZCI6Ijk5OTQzMzEiLCJwYXRoIjpbMjQyOCwxNiw2OTQ2NF19&depth=5&limit=50", 

      {{}}

      Expected Results

       

      A new cursor should be returned, and you should be able to get all of the descendant pages 

       

      Actual Results

      When you get a duplicate cursor, you can't pull more results, because all calls return the same results.

      Workaround

      Currently, there is no known workaround for this behavior. A workaround will be added here when available

              Assignee:
              Unassigned
              Reporter:
              Sana Jawed SJ (Inactive)
              Votes:
              15 Vote for this issue
              Watchers:
              17 Start watching this issue

                Created:
                Updated: