You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 30, 2020. It is now read-only.
Assuming you support multiple HTTP clients (I didn't see anything saying you don't), there's a race condition in the HTTP API.
If a client tries to submit a unit using /units/NAME, and someone else does it before they do, then they will not receive any notification that the submission failed. This is because the same endpoint is used for modify and submit, so a modify operation happens instead. However, I don't believe the client is currently told which one happened.
One could try to work around this by checking to see if the unit exists before submitting it, but obviously the race condition is even larger then. Another workaround is inspecting the state of the unit after you submit it to make sure it matches what you think it should be -- but it seems like that shouldn't be necessary.
Ideally, the API should either use different endpoints for modify/submit, or return a status indicating which of the two actions happened.
Assuming you support multiple HTTP clients (I didn't see anything saying you don't), there's a race condition in the HTTP API.
If a client tries to submit a unit using /units/NAME, and someone else does it before they do, then they will not receive any notification that the submission failed. This is because the same endpoint is used for modify and submit, so a modify operation happens instead. However, I don't believe the client is currently told which one happened.
One could try to work around this by checking to see if the unit exists before submitting it, but obviously the race condition is even larger then. Another workaround is inspecting the state of the unit after you submit it to make sure it matches what you think it should be -- but it seems like that shouldn't be necessary.
Ideally, the API should either use different endpoints for modify/submit, or return a status indicating which of the two actions happened.