Last, prev links not returned in search when page>lastpage

Bug #1731301 reported by Toto Bille
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
New
Undecided
Kit Randel

Bug Description

Read comment: https://github.com/canonical-websites/snapcraft.io/pull/135#issuecomment-342897912
This behavior is the same if I require a negative page.

Tags: doc search
Revision history for this message
Kit Randel (blr) wrote :

Hi Thomas, as mentioned on Slack, this is by design. A search request with an out of bound page request will always return the last page. You can programatically determine that this is the last page given the lack of a 'last' and 'next' links (assuming you meant "last, next" rather than "last, prev", as that indeed would be a bug).

Revision history for this message
Kit Randel (blr) wrote :

I think a case could definitely be made however that for an out of bound request, where self is page=30000, providing a last link would be useful.

Changed in snapstore:
assignee: nobody → Kit Randel (blr)
Revision history for this message
Kit Randel (blr) wrote :

On reflection, I wonder if it wouldn't be better to preserve this behaviour (no "last" and "next" links on the last page), but ensure "self" points to the last page.

e.g.

When a request for page 6 is made in a 5 page set, currently self=6 in the response, but misleadingly "prev" will be 4, given we have actually returned page 5. The fact that we don't ensure self points to the actual page returned is potentially the real bug (the HAL spec is vague about all this).

Celso Providelo (cprov)
summary: - Last, prev links not returned when page>lastpage
+ Last, prev links not returned in search when page>lastpage
Celso Providelo (cprov)
tags: added: search snapdevicegw
Celso Providelo (cprov)
tags: added: doc
removed: snapdevicegw
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.