Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
code-asher merged 7 commits into
mainfrom
asher/create-workspace-init
Jul 16, 2026
Merged

fix: do not send or use stale init dynamic parameter state#27283
code-asher merged 7 commits 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.

Comment thread site/src/pages/CreateWorkspacePage/CreateWorkspacePage.test.tsx Outdated
Comment thread site/src/pages/CreateWorkspacePage/CreateWorkspacePage.test.tsx
Comment thread site/src/pages/CreateWorkspacePage/CreateWorkspacePage.test.tsx Outdated
Comment thread site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx Outdated
Comment thread site/src/testHelpers/parameters.ts Outdated
Comment thread site/src/testHelpers/parameters.ts
Comment thread site/src/testHelpers/parameters.ts
@code-asher

Copy link
Copy Markdown
Member Author

Turns out the stories did not need updating because unlike the edit parameters page they test the page view, not the page where I actually made the changes. So this should be good to go.

@code-asher
code-asher marked this pull request as ready for review July 16, 2026 19:38
@code-asher
code-asher force-pushed the asher/create-workspace-init branch from aa2c2eb to 49a621a Compare July 16, 2026 19:43
@code-asher
code-asher merged commit 2ac2295 into main Jul 16, 2026
27 checks passed
@code-asher
code-asher deleted the asher/create-workspace-init branch July 16, 2026 20:55
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 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