Skip to content

fix: do not send or use stale init dynamic parameter state - #26357

Merged
code-asher merged 1 commit into
mainfrom
asher/edit-parameter-flake
Jun 16, 2026
Merged

code-asher merged 1 commit into
mainfrom
asher/edit-parameter-flake

Conversation

@code-asher

@code-asher code-asher commented Jun 12, 2026 •

Copy link
Copy Markdown
Member

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.

I would like to look later into making a similar change to the create workspace page. I think it technically has the same bug, but in that case the initial parameters are resolved synchronously from the URL so it probably cannot actually manifest in the same way.

Fixes https://linear.app/codercom/issue/DEVEX-329/flake-test-e2e-updateworkspacespects-update-workspace-with-ephemeral

@linear-code

linear-code Bot commented Jun 12, 2026

Copy link
Copy Markdown

DEVEX-329

@code-asher code-asher changed the title fix: ensure we do not send or use stale init dynamic parameter messages fix: do not send or use stale init dynamic parameter messages Jun 12, 2026
@code-asher code-asher changed the title fix: do not send or use stale init dynamic parameter messages fix: do not send or use stale init dynamic parameter state Jun 12, 2026
@code-asher
code-asher force-pushed the asher/edit-parameter-flake branch 2 times, most recently from ec25734 to cea1144 Compare June 12, 2026 21:46
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, getting back an incorrect
   reply 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.
@code-asher
code-asher force-pushed the asher/edit-parameter-flake branch from cea1144 to 3944c36 Compare June 12, 2026 21:53
@code-asher
code-asher requested a review from jeremyruppel June 13, 2026 00:02

@jeremyruppel jeremyruppel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks great! 👍

@code-asher
code-asher merged commit b5b80db into main Jun 16, 2026
29 checks passed
@code-asher
code-asher deleted the asher/edit-parameter-flake branch June 16, 2026 00:38
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2026
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