|
| 1 | +--- |
| 2 | +"@objectstack/runtime": patch |
| 3 | +"@objectstack/metadata": patch |
| 4 | +--- |
| 5 | + |
| 6 | +fix(runtime,metadata): the default local environment id is `env_local`, not `proj_local` (#13366) |
| 7 | + |
| 8 | +The v5.0 `project` to `environment` rename changed the default local environment |
| 9 | +id and shipped that change on the surfaces most people meet: `packages/cli`'s |
| 10 | +`CHANGELOG.md` records "Default local env id: `proj_local` -> `env_local`", the |
| 11 | +`os dev` / `os start` / `os serve` commands emit `env_local`, and |
| 12 | +`content/docs/deployment/cli.mdx` documents `env_local` as the default. Two |
| 13 | +sites never received it and kept stamping `proj_local`. |
| 14 | + |
| 15 | +FROM: `createStandaloneStack()` — with no `environmentId` in its config and no |
| 16 | +`OS_ENVIRONMENT_ID` in the environment — stamped `proj_local` on the kernel it |
| 17 | +composed, and `MetadataPlugin` used `proj_local` to fill the environment-artifact |
| 18 | +validation envelope for a bare definition. |
| 19 | + |
| 20 | +TO: both stamp `env_local`. |
| 21 | + |
| 22 | +WHO SEES IT. Only a host that calls `createStandaloneStack` (or |
| 23 | +`createDefaultHostConfig`) **directly** and lets the id default. A boot started |
| 24 | +by `os dev` / `os start` never reached the changed line: those commands export |
| 25 | +`OS_ENVIRONMENT_ID=env_local` into the child process, which the fallback yields |
| 26 | +to. Where the id is observable — row scoping in `ObjectQLPlugin`, the |
| 27 | +`X-Environment-Id` header, `sys_metadata.environment_id` — such an embedder now |
| 28 | +sees `env_local` where it saw `proj_local`, so an install with rows already |
| 29 | +written under the old id should set `environmentId: 'proj_local'` (or |
| 30 | +`OS_ENVIRONMENT_ID=proj_local`) explicitly to keep them addressed. That escape |
| 31 | +hatch is unchanged and still wins over the default. |
| 32 | + |
| 33 | +NOT CHANGED, deliberately: `@objectstack/cloud-connection` still treats BOTH |
| 34 | +spellings as the local sentinel, so a persisted `OS_ENVIRONMENT_ID=proj_local` |
| 35 | +config keeps being recognised as local rather than presented to the control |
| 36 | +plane as a cloud environment id; and `package-state-store`'s separate `'default'` |
| 37 | +fallback keeps its own spelling, because renaming it would re-key persisted |
| 38 | +package-disable state files. |
0 commit comments