/api/v1/snaps/purchases/orders returning too much stuff

Bug #1795833 reported by John Lenton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snap Store Server
Fix Released
High
Matias Bordese

Bug Description

When the search endpoint returns snaps that are marked as priced, snapd hits the orders endpoint /api/v1/snaps/purchases/orders to add pricing information to the snaps.

This is the request snapd does:

GET /api/v1/snaps/purchases/orders HTTP/1.1
Host: api.snapcraft.io
User-Agent: snapd/2.3... (series 16; classic) ubuntu/16.04 (amd64) linux/4....
Accept: application/json
Authorization: Macaroon root=\"...\", discharge=\"...\"
X-Device-Authorization: Macaroon root=\"...\"
X-Ubuntu-Architecture: amd64
X-Ubuntu-Classic: true
X-Ubuntu-Series: 16
X-Ubuntu-Wire-Protocol: 1
Accept-Encoding: gzip

I'll attach the response I get back, four seconds (!) later.

Revision history for this message
John Lenton (chipaca) wrote :
Revision history for this message
William Grant (wgrant) wrote :

John's the worst case scenario for this API, having substantially more ClickPackageSubscriptions than anyone else: https://pastebin.canonical.com/p/6BmzpwMppB/

Changed in snapstore:
importance: Undecided → High
status: New → Triaged
Revision history for this message
William Grant (wgrant) wrote :

It seems unnecessary for SCA to return free snaps in the order listing, and it's also slower than it should be to return 1100. But we could also possible just stub out the API in snapdevicegw for now, given purchasing isn't generally available.

tags: added: api dashboard performance
Revision history for this message
John Lenton (chipaca) wrote :

We could also make snapd forget about the orders endpoint entirely :)

Matias Bordese (matiasb)
Changed in snapstore:
status: Triaged → In Progress
assignee: nobody → Matias Bordese (matiasb)
Matias Bordese (matiasb)
Changed in snapstore:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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