Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

ui: avoid "async race" with new client POST #35

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

sclem
Copy link
Contributor

@sclem sclem commented Jan 17, 2020

The getClients() and POST request were being issued one after another
(not waiting for the POST to return). This can cause the GET /clients to
return the old list before the user config is updated. Waiting for the
POST to return before retrieving the new client list fixes the race.

This behavior can be reproduced by adding a time.Sleep(time.Second) to
the CreateClient server handler.

Not sure if there's supposed to be a .github/PULL_REQUEST_TEMPLATE.md; yes I read the code of conduct and contributor guide.

The getClients() and POST request were being issued one after another
(not waiting for the POST to return). This can cause the GET /clients to
return the old list before the user config is updated. Waiting for the
POST to return before retrieving the new client list fixes the race.

This behavior can be reproduced by adding a time.Sleep(time.Second) to
the CreateClient server handler.
@suom1 suom1 merged commit 3f24fb2 into EmbarkStudios:master Jan 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants