Search returns total different than actual number of snaps
Bug #1888664 reported by
Toto Bille
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snap Store Server |
Confirmed
|
Low
|
Unassigned |
Bug Description
Reported here: https:/
It seems that when searching for zsh the result gives 3 snaps but the total calculated of snaps is 4.
To reproduce:
```
curl -H 'X-Ubuntu-Store: ubuntu' "https:/
{
"total": 4,
"_embedded": {
"clickindex
},
...
}
```
Changed in snapstore-server: | |
status: | New → Confirmed |
To post a comment you must log in.
There's a "ghost snap" in the results for zsh, namely 'zsh-shell', this is a snap that had releases at some point but now has all its channels closed.
The list of 3 snaps is therefore accurate, those are the three that do have published releases. There might be a quirk in the logic to calculate the "total" value, because that is done on the list of snaps whose information did match the search criteria. So:
1- search for snaps matching "zsh" in the snap index, this returns 4 results.
2- When building the list of details for snaps, actually look at which ones have released revisions, and only 3 of the originally-found 4 do.
3- Calculate "total" based on the 4 results from #1, not the 3 from the properly-filtered list fom #2.
This probably needs fixing store-side, but note also that the "search" api is deprecated and you should be using the newer "find" api instead (http:// api.snapcraft. io/docs/ search. html#snaps_ find).