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

Issue 20846 planning#21311

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

Draft
jaaydenh wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromcursor/issue-20846-planning-a4cb
Draft

Conversation

@jaaydenh
Copy link
Contributor

Fixes#20846

This PR addresses the poor user experience caused by the 30-minute hardcoded timeout on dynamic parameter WebSockets, which previously required users to refresh the page.

Key Changes:

  • Backend (coderd/parameters.go):

    • Reduced the WebSocket inactivity timeout from 30 minutes to 3 minutes.
    • Implemented activity-based timeout refresh: the timer resets whenever a message is received from the client.
    • Utilizedquartz.Clock for testability of the timeout mechanism.
    • Added comprehensive tests for the new timeout and activity refresh behavior.
  • Frontend (site/src/hooks/useDynamicParametersWebSocket.ts):

    • Introduced a newuseDynamicParametersWebSocket hook for managing dynamic parameter connections.
    • Integratedwebsocket-ts for automatic reconnection with exponential backoff (1-6 seconds).
    • Implemented visibility-based reconnection: the WebSocket attempts to reconnect when the browser tab becomes visible.
    • Ensures current form values are resent upon reconnection to restore server-side state.
    • Applied the new hook toCreateWorkspacePage.tsx,WorkspaceParametersPageExperimental.tsx, andTemplateEmbedPageExperimental.tsx to standardize WebSocket handling.

Why these changes?

This significantly improves the user experience by:

  1. Reducing frustration: Users no longer encounter a hard disconnect after 30 minutes, especially if they briefly step away.
  2. Providing seamless interaction: Auto-reconnection and state restoration make the dynamic parameter forms more robust and resilient to network interruptions or tab changes.
  3. Enhancing testability: Usingquartz.Clock ensures the backend timeout logic is reliably testable.

Open in Cursor Open in Web

Introduce a reusable hook for dynamic parameter websocket connections. This hook manages connection state, automatic reconnection, and inactivity timeouts. It also centralizes the websocket logic, making it easier to manage and test.Co-authored-by: jaayden.halko <jaayden.halko@gmail.com>
@cursor
Copy link

cursorbot commentedDec 17, 2025

Cursor Agent can help with this pull request. Just@cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions
Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign ourContributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commentingrecheck in this Pull Request.Posted by theCLA Assistant Lite bot.

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

Reviewers

No reviews

Assignees

@jaaydenhjaaydenh

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Auto-reconnect web socket on dynamic parameters create workspace page and reduce web socket timeout

2 participants

@jaaydenh@cursoragent

[8]ページ先頭

©2009-2025 Movatter.jp