- Notifications
You must be signed in to change notification settings - Fork905
fix: sync websocket params with form params#17895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -136,7 +136,7 @@ const CreateWorkspacePageExperimental: FC = () => { | |||
return; | |||
} | |||
if (!initialParamsSentRef.current && response.parameters.length > 0) { | |||
if (!initialParamsSentRef.current && response.parameters?.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
❤️
The default param value is sent on the form load. Then it all works from my brief testing. I am ok to merge this.@jaaydenh do you think we can make a unit test for this without the BE? Some set of mocked responses, and we come up with some table of behaviors together? |
jaaydenh commentedMay 19, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Createdcoder/internal#650 to track tests for this |
4412f19
intomainUh oh!
There was an error while loading.Please reload this page.
The current issue is that when multiple parameters are added or removed from a form because a user change in a conditional parameter value. The websocket parameters response gets out of sync with the state of the parameters in the form.
The form state needs to be maintained because this is what gets submitted when the user attempts to create a workspace.
Fixes:
When autofill params are set from the url, mark these params as touched in the form. This is necessary as only touched params are sent in the request to the websocket. These params should technically count as being touched because they were preset from the url params.
Create a hook to synchronize the parameters from the websocket response with the current state of the parameters stored in the form.