Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
jaaydenh merged 4 commits intomainfromjaaydenh/sync-form-parameters
May 19, 2025

Conversation

jaaydenh
Copy link
Contributor

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:

  1. 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.

  2. Create a hook to synchronize the parameters from the websocket response with the current state of the parameters stored in the form.

@jaaydenhjaaydenh self-assigned thisMay 16, 2025
@jaaydenhjaaydenh requested a review fromEmyrkMay 16, 2025 22:11
@@ -136,7 +136,7 @@ const CreateWorkspacePageExperimental: FC = () => {
return;
}

if (!initialParamsSentRef.current && response.parameters.length > 0) {
if (!initialParamsSentRef.current && response.parameters?.length > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@jaaydenhjaaydenh requested a review fromEmyrkMay 18, 2025 12:35
@Emyrk
Copy link
Member

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
Copy link
ContributorAuthor

jaaydenh commentedMay 19, 2025
edited
Loading

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?

Createdcoder/internal#650 to track tests for this

@jaaydenhjaaydenh merged commit4412f19 intomainMay 19, 2025
34 checks passed
@jaaydenhjaaydenh deleted the jaaydenh/sync-form-parameters branchMay 19, 2025 14:49
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 19, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@EmyrkEmyrkEmyrk approved these changes

Assignees

@jaaydenhjaaydenh

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@jaaydenh@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp