Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snaplist: do not automatically mark configured on failed GET request #1425

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

ogayot
Copy link
Member

@ogayot ogayot commented Sep 16, 2022

When a client sends a GET /snaplist request and an error occurs on the server side, we return a response of the following form:

 { "status": "FAILED", ... }

This effectively gives a chance to the client to retry the same request and expect a different outcome (for instance when a temporary network failure occurs).

Having said that, when the server returns "status": "FAILED", it also automatically marks the snaplist model configured. This is wrong because if the next GET /snaplist request succeeds, the user will be prompted to select some snaps to install ; but the installation will already be running in the background. Depending on the timing, it might or might not install the snaps that the user selected.

Fixed by not marking the snaplist model configured automatically. The client is made responsible from sending a POST /snaplist ; even in case of error.

Addresses the following bug report:
https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1989179

When a client sends a GET /snaplist request and an error occurs on the
server side, we return a response of the following form:

 { "status": "FAILED", ... }

This effectively gives a chance to the client to retry the same request
and expect a different outcome (for instance when a temporary network
failure occurs).

Having said that, when the server returns "status": "FAILED", it also
automatically marks the snaplist model configured. This is wrong because
if the next GET /snaplist request succeeds, the user will be prompted to
select some snaps to install ; but the installation will already be
running in the background. Depending on the timing, it might or might
not install the snaps that the user selected.

Fixed by not marking the snaplist model configured automatically. The
client is made responsible from sending a POST /snaplist ; even in case
of error.

Signed-off-by: Olivier Gayot <[email protected]>
Copy link
Collaborator

@dbungert dbungert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ogayot ogayot merged commit 74cad94 into canonical:main Sep 20, 2022
@ogayot ogayot deleted the fix-try-again-not-waiting branch September 20, 2022 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants