Repository navigation
Conversation
Documentation CheckUpdates Needed
Automated review via Coder Agents |
Emyrk
left a comment
There was a problem hiding this comment.
With this PR it no longer blocks the workspace build. The stale value falls back to the parameter's default, and the substitution is reported as a warning rather than an error.
This is actually dangerous, and the current blocking behavior is current.
An example I have seen in the past, that this behavior actually used to exist (maybe in regular params though, not dynamic).
- A customer had a region value,
us-east,us-west. - A region was removed, and all workspaces on that region switched to the new default since their value was no longer valid.
- By switching, their volumes on their original choice were deleted.
The correct behavior is to fail and prevent the build. A resolution is to manually change the param values.
I am open to adding more UI errors/warnings/suggestions. But we cannot have the backend automate this behavior.
|
@Emyrk thank you, that's really critical security feedback 🙏 I see it now, I am learning. The suggestion was for the UI to preselect a default, but I see this is still defaulting it from the backend. I will drop the backend resolver changes, make this change more UI-centric to nudge a fixed value to pre-select.
|
|
closing this; I don't like the UI solution I keep getting, which I don't understand, but which I think is due to a separate issue now being idenified. This is fixable for the customer with manual intervention on their part, however I am unsure if the ui native solution for this claude suggests for me will work. closing this until I can work something better. |
CLIENT-697
Summary
A mutable
coder_parameterwhose selected option is removed from a template update but used in a workspace build could block further changes.With this PR it no longer blocks the workspace build. The stale value falls back to the parameter's default, and the substitution is reported as a warning rather than an error.
Immutable properties still report as an error.
Problem
When a template update removes an option value that a workspace has had already selected, the stored value is no longer a member of that option set.
In the web UI the preview websocket returns the same per-parameter error, which disables "Update and start"; on a template with
required inputsinputs are disabled as well, leaving the user no way to select a valid option or proceed.The CLI appears unaffected only because it drops invalid options client-side and retries against the active version, so
coder sshmasked a server-side failure rather than avoiding it.Fix
ResolveParametersnow drops a carried-forward value parameter's options, letting the existing defaultbackfill supply the new default. Values supplied with the build or by a preset are still validated, since those were asked for explicitly, and immutable parameters are left alone.The preview endpoints render through
RenderReconciled, which re-renders without the dead value and attaches a warning carrying astale_optioncode, so the form shows the default option.The parameters page no longer disables its inputs via
?templateVersionId=, because the build it submits is the update the template requires. Without that query parameter the form stays disabled as before.immutable stale parameter still cannot be updated



mutable stale option can be updated
mutable radio button can be updated