Description
Problem
Workspace deletions are failing when the workspace template contains new immutable parameters that weren't present when the workspace was originally created. The system incorrectly detects this as a parameter change from "" to new_value, even though the operation is a deletion.
This is the body I get as part of a 400 Bad Request
response.
Root Cause
- Old workspaces don't have default values saved in the database for parameters that were added later
- New workspaces work correctly because default values are now saved to the database
- The validation logic treats the missing previous value as an empty string, triggering immutable parameter validation during deletion
Current Behavior
- User attempts to delete an outdated workspace
- System requires workspace update before allowing deletion
- This creates unnecessary friction for a simple deletion operation
Expected Behavior
Workspace deletion should succeed without requiring an update, even when new immutable parameters have been added to the template.
Proposed Solution
Accept value for newly-present immutable param on new build.
Additional Context
This affects all workspace state transitions that validate parameters the same way, not just deletions. However, deletion is the most problematic case since users expect to be able to delete outdated workspaces without updating them first.
Disclaimer: this issue description was first drafted by https://github.com/apps/blink-so.