stac-utils / stac-utils/pgstac
missing previous link when `offset>0` but `limit > number_matched`
Nobody has claimed this yet.
- Dominant language
- PLpgSQL
- Stars
- 223
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
we check if we have needs for previous/next links. I believe there is a case that is missing (ref: https://github.com/stac-utils/stac-fastapi-pgstac/pull/155/files#r1910644543) when you can have less than limit number of collection (e.g n_collections=4 and limit=10) but user may have provided offset=.
Anytime there is an offset>0 I feel we should have a previous link
cc @bitner
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/pgstac/sql/004a_collectionsearch.sql around line 106 and compare the link-condition logic with the referenced stac-fastapi-pgstac pull request discussion. Reproduce a search with offset > 0 and fewer matched collections than limit, then verify that the response includes a previous link.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100