crates.io icon indicating copy to clipboard operation
crates.io copied to clipboard

`prev_page` field is always `null` on search

Open GuillaumeGomez opened this issue 11 months ago • 3 comments

Current Behavior

prev_page is always null.

Expected Behavior

It should return the seek for the previous page if there is one.

Steps To Reproduce

You can see the issue on docs.rs:

Go to https://docs.rs/releases/search?query=sysinfo Click "next page"

Then you can see that there is no "previous page" button. I originally suspected a bug on docs.rs side but after investigating, it looks like the ["api", "v1", "crates"] query always return a null prev_page in the JSON response.

Environment

No response

Anything else?

No response

GuillaumeGomez avatar Jan 08 '25 18:01 GuillaumeGomez

That's intended behavior. The way seek pagination is implemented we can't offer reverse traversal without sacrificing performance.

Turbo87 avatar Jan 08 '25 19:01 Turbo87

I see. I suppose we can store the previous page in the cookie session... Gonna find something out.

GuillaumeGomez avatar Jan 08 '25 19:01 GuillaumeGomez

That's intended behavior. The way seek pagination is implemented we can't offer reverse traversal without sacrificing performance.

I don't expect significant performance issues. It would only involve some reverse handling (including query and result processing). This is actually one of the enhancement items on my backlog.

eth3lbert avatar Jan 09 '25 03:01 eth3lbert