mirror of
https://github.com/coder/coder.git
synced 2026-09-22 13:10:21 +08:00
Previously, there could be a gap where the web socket has been connected and gets the initial message but the build parameters request was still in flight. This caused two issues: 1. Because we only send initial parameters as a response to a message, when the message comes first and the build parameters have not resolved yet, we end up not sending the initial parameters, meaning the form could be stale until the next edit the user makes. 2. And if the user does make an edit, once we get that response back we would then send the initial parameters, essentially reverting back to the initial state since the initial params do not include the user's edits. So the user would need a second edit to finally sync up. To resolve both issues, we ignore the web socket's initial message until we get the build parameters, at which point we decide whether we can use that initial message (when there are no build params) or if we need to continue ignoring it and send the initial parameters to get the correct state then finally render the form.