Skip to content

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

Draft
code-asher wants to merge 1 commit into
mainfrom
asher/create-workspace-init
Draft

fix: do not send or use stale init dynamic parameter state#27283
code-asher wants to merge 1 commit into
mainfrom
asher/create-workspace-init

Conversation

@code-asher

@code-asher code-asher commented Jul 15, 2026

Copy link
Copy Markdown
Member

In summary, we use the init message if we have no autofill params. If we do, then we ignore the init message, send another message with the autofilled values, and then when we get that response, finally we render the form since we know we have good state. This eliminates the possibility of temporarily rendering with stale state.

This is the same fix that was applied to the edit page, but on the create page this time. The only difference is that the create page does not need to wait on a build parameters query, instead it has to wait on the first message from the socket (to get defaults).

This also makes one change where we would send the defaults in the init message. The server already knows the defaults so there is no need to send them. The advantage here is that we no longer need to wait for the first message, and it also fixes an issue where fields with blank values were getting validation errors because they were not filled out, before the user had a chance to actually fill them out.

Closes https://linear.app/codercom/issue/DEVEX-340/flake-create-workspace-and-overwrite-default-parameters

@linear-code

linear-code Bot commented Jul 15, 2026

Copy link
Copy Markdown

DEVEX-340

@code-asher code-asher force-pushed the asher/create-workspace-init branch from 64ac33a to 78148ae Compare July 15, 2026 23:36
This is the same fix that was applied to the edit page, but on the
create page this time.  The only difference is that the create page does
not need to wait on a build parameters query, instead it has to wait on
the first message from the socket (to get defaults).

This also makes one change where we would send the defaults in the init
message.  The server already knows the defaults so there is no need to
send them.  The advantage here is that we no longer need to wait for the
first message, and it also fixes an issue where fields with blank values
were getting validation errors because they were not filled out, before
the user had a chance to actually fill them out.
@code-asher code-asher force-pushed the asher/create-workspace-init branch from 78148ae to 2699b23 Compare July 15, 2026 23:50
@code-asher code-asher marked this pull request as draft July 15, 2026 23:55
@code-asher code-asher marked this pull request as ready for review July 15, 2026 23:58
@code-asher code-asher requested a review from jeremyruppel July 15, 2026 23:59
@code-asher code-asher marked this pull request as draft July 16, 2026 00:02
@code-asher

Copy link
Copy Markdown
Member Author

Ah completely forgot to update the stories so I moved it back to a draft. The actual change can still be reviewed though.

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.

1 participant