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

Skip to content

Textarea parameters lose characters during typing on Create Workspace page #23418

Description

@35C4n0r

Bug Description

When filling in textarea parameters on the Create Workspace page, users experience dropped characters, input lag, and inconsistent text during typing. The textarea intermittently reverts to an earlier state, causing typed characters to disappear.

Root Cause

The useSyncFormParameters hook overwrites form values with stale WebSocket responses. The sequence:

  1. User types abc in a textarea parameter
  2. After a 500ms debounce, the value abc is sent to the server via WebSocket
  3. User continues typing — form now holds abcde
  4. The server responds with abc (echo of what was sent)
  5. useSyncFormParameters sees the server value differs from the form value, overwrites the form back to abc
  6. The characters de are lost

Since the textarea is a fully controlled React component, the overwritten form value immediately propagates to the DOM, causing the visible snap-back.

Expected Behavior

Characters typed after the WebSocket request should not be lost. The sync hook should detect that a server response is stale (an echo of what was sent, not a server-side transformation) and preserve the user's in-progress input.

Affected Components

  • site/src/modules/hooks/useSyncFormParameters.ts — always applies server value when param.value.valid is true
  • site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.tsx — calls the sync hook without stale-response awareness
  • site/src/modules/workspaces/DynamicParameter/DynamicParameter.tsx — textarea is fully controlled, fires onChange on every keystroke

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions