Skip to content

fix(site): use the active version on the parameters page when it is required - #30906

Draft
jeremyruppel wants to merge 1 commit into
mainfrom
jeremy/dash-105-bug-workspace-deadlock-with-invalid-parameter-automatic
Draft

jeremyruppel wants to merge 1 commit into
mainfrom
jeremy/dash-105-bug-workspace-deadlock-with-invalid-parameter-automatic

Conversation

@jeremyruppel

Copy link
Copy Markdown
Contributor

Fixes #19676. Fixes DASH-105.

Follow-up to #30660. That PR unlocked the parameters form for users who cannot change template versions, but only when the page was opened with ?templateVersionId=<active version>. Opening it any other way (Settings → Parameters, the build parameters popover, a bookmark) still showed a read-only form against the old version, so a member whose saved value the new version rejects could not fix it there.

The page now always targets the template's active version for these users, whatever the URL says. Builds on any other version are rejected for them anyway. #30660's check in the view already unlocks the form on the active version, so the view is unchanged.

The parameters websocket now waits for permissions to load, since they decide which version it connects to. Switching versions after connecting would drop the new socket's initial response.

Decisions and notes
Testing
  • New Vitest test: a member opens the page without ?templateVersionId on an outdated workspace whose template requires the active version. The websocket connects once, to the active version, and submitting sends the active version. Fails without the fix.
  • Storybook and Vitest for this page pass; biome, oxlint, tsc, and knip are clean.
  • Manually on a local dev server with a Premium license: template with require_active_version, a member workspace built on v1 with size=large, v2 removes large. Settings → Parameters was read-only before the fix and editable after; updating built the workspace on v2.

Generated by Coder Agents on behalf of @jeremyruppel.

@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

DASH-105

@aslilac aslilac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I already fixed this to send the user to this page with the correct version id specified. why do we need this?

@jeremyruppel

Copy link
Copy Markdown
Contributor Author

the decision log on #30660 says:

Opening the parameters page without ?templateVersionId= is still read-only for these users, and immutable parameters with errors still block the update.

this PR fixes that first part. going directly to Settings → Parameters from the sidebar doesn't pass a template version id, so the page is still read-only there. with this change, users who can't change versions always get the active version on this page, whatever the query string says

…equired

Users who cannot change template versions on a template that requires the
active version could only edit parameters when the page was opened with
?templateVersionId=<active>. Opening it from the settings sidebar showed a
read-only form, leaving them stuck when the new version rejected a saved
value. The page now always targets the active version for these users.

Fixes #19676
@jeremyruppel
jeremyruppel force-pushed the jeremy/dash-105-bug-workspace-deadlock-with-invalid-parameter-automatic branch from 1b7de3f to c4fc390 Compare October 16, 2026 19:22
@aslilac

aslilac commented Oct 16, 2026

Copy link
Copy Markdown
Member

I'm not a fan of shadowing an explicitly specified value. this could be fine as a default but I don't think it should override.

Comment on lines +129 to +130
// The target version depends on permissions.
if (!permissionsLoaded) return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't like adding another condition here. why not just leave templateVersionId unresolved until permissions is set so that it falls through to the early return immediately after this?

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: workspace deadlock with invalid parameter & automatic updates set

2 participants