fix: workspace upgrade scaling - merge config and fix tier thresholds
Merged
KH
1y ago+182+182+012345678901234567890123456789-19-19-01234567890123456789
Two bugs fixed:
-
resize() was sending a partial config that replaced the entire Fly.io
machine config, wiping out the image, services, auto_stop settings,
and other env vars. Now it fetches the current config first and merges
the new guest specs into it, preserving all existing settings. -
getCurrentTier() had wrong memory thresholds that incorrectly mapped
actual machine memory to tier names (e.g., 2048MB was returning 'large'
instead of 'small'). This broke auto-scaling by making the system think
workspaces were already at higher tiers than they actually were.
Also fixed: skip_launch is now passed as a query parameter (matching
updateMachineImage behavior) and response errors are properly checked.