Setting a default track to a track that does not exist returns an undocumented 400
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snap Store Server |
New
|
Undecided
|
Unassigned | ||
Snapcraft |
Fix Released
|
Low
|
Sergio Schvezov |
Bug Description
Hello,
I am in the process of implementing being able to set a default track from snapcraft, while testing against staging I ran into the following:
ubuntu@
Name Status Creation-Date Version-Pattern
latest active - -
candybar default 2019-10-
x active 2020-08-
ubuntu@
Default track for 'candycane' set to 'x'.
ubuntu@
Received 400: 'Select a valid choice. The given value is not one of the available choices.'
ubuntu@
Received 400: 'Select a valid choice. The given value is not one of the available choices.'
Describing,
- setting to a valid user created (on behalf of the Snap Store admin) track works just as expected
- setting to a non existent track returns a 400, this is not documented on https:/
- trying to set to latest returns a 400 as well. The latest agreement is that this operation should be possible.
The important bit is to know what the actual error code to commit to is to correctly capture and return a nicer Snapcraft message to the user.
Thanks
summary: |
- Setting a default track to a track that does not exist returns a 400 and - a standard django message + Setting a default track to a track that does not exist returns an + undocumented 400 |
Changed in snapcraft: | |
status: | New → Fix Released |
importance: | Undecided → Low |
assignee: | nobody → Sergio Schvezov (sergiusens) |
We solved the error handling client side (Snapcraft) with a channel map query to the Snap Store before trying to set the track. What is missing from the Snap Store is being able to set "latest" as the default.