|
2 | 2 | '@objectstack/metadata-protocol': patch |
3 | 3 | --- |
4 | 4 |
|
5 | | -fix(metadata-protocol): a view container with a bare `list`, saved for an object another package ships, no longer replaces that package's `<object>.default` |
| 5 | +fix(metadata-protocol): a view container saved for an object another package ships no longer replaces that package's views or its default |
6 | 6 |
|
7 | 7 | Clause-②: no |
8 | 8 |
|
9 | | -- **What was wrong.** A runtime view container whose `list` names no key expands that list to `<object>.default`. Saved under another name, in another package or in none, for an object a code package ships, the expansion replaced that package's `<object>.default` on `GET /api/v1/meta/view?object=<object>`: the container's columns, still stamped with the shipping package's `_packageId` and `_provenance: 'package'`. On an environment-scoped kernel the by-name read `GET /api/v1/meta/view/<object>.default` kept the packaged view, so the two reads disagreed. On an unscoped kernel the by-name read served the replacement too, for a container saved into a package or environment-wide. |
10 | | -- **What it does now.** For an object a code package ships, the bare `list` of a container that belongs to another package, or to none, expands under the container's own name, `<object>.<container name>`. Both reads of `<object>.default` answer the packaged view, unchanged. |
11 | | -- **What the renamed view carries.** The container's own package as `_packageId` (none for a package-less container), and no other package's `_provenance` or protection envelope. |
12 | | -- **What stays.** These still expand their bare `list` to `<object>.default`: a container bound to the package that ships the object, a package-less overlay of that package's own container saved under that container's name, and a container on an object no code package ships. A `list` that names its own key, `listViews`, `form` and `formViews` expand under the same names as before. A write to `<object>.default` by its own name still overrides it on both reads. |
13 | | -- **What changes for a caller.** Such a container's default list is now listed as `<object>.<container name>` instead of `<object>.default`. A navigation `viewName` or a form-action `target` that named `<object>.default` to reach that container's list now reaches the shipping package's view; name `<object>.<container name>` instead. |
| 9 | +- **What was wrong.** A runtime view container expands each member to `<object>.<key>`. A `list` that names no key becomes `<object>.default`, a `form` becomes `<object>.form`, and every member that names a key uses that key. Saved under another name, in another package or in none, for an object a code package ships, those expansions replaced that package's views of the same names on `GET /api/v1/meta/view?object=<object>`. The replacements were still stamped with the shipping package's `_packageId` and `_provenance: 'package'`. |
| 10 | + - On an environment-scoped kernel, the by-name read `GET /api/v1/meta/view/<name>` kept the packaged view, so the two reads disagreed. |
| 11 | + - On an unscoped kernel, the by-name read served the replacement too, for a container saved into a package or environment-wide. |
| 12 | + - The container's default list kept `isDefault: true`, so the object listed two list defaults. |
| 13 | +- **What it does now.** For an object a code package ships, a container that belongs to another package, or to none, expands every member under its own name: |
| 14 | + - a `list` that names no key becomes `<object>.<container name>`; |
| 15 | + - every other member becomes `<object>.<container name>.<key>`. That covers a `list` that names its key, each `listViews` and `formViews` entry, and `form`. |
| 16 | + |
| 17 | + None of these views carries `isDefault`. Every name the shipping package serves answers its packaged view on both reads, unchanged, and the only `isDefault` views the object lists are the shipping package's. |
| 18 | +- **One exception.** When the shipping package itself serves `<object>.<container name>` (a container named after one of that package's keys), the container's default list becomes `<object>.<container name>.<container name>` instead. |
| 19 | +- **A container with no name of its own** expands nothing on such an object. |
| 20 | +- **What these views carry.** The container's own package as `_packageId` (none for a package-less container), and no other package's `_provenance` or protection envelope. |
| 21 | +- **What stays.** Three kinds of container expand exactly as before, `isDefault` included: |
| 22 | + - a container bound to the package that ships the object; |
| 23 | + - a package-less overlay of that package's own container, saved under that container's name; |
| 24 | + - a container on an object no code package ships. |
| 25 | + |
| 26 | + A write to `<object>.default` by its own name still overrides it on both reads. |
| 27 | +- **What changes for a caller.** Such a container's views are now served under new names: |
| 28 | + - its default list as `<object>.<container name>`, instead of `<object>.default`; |
| 29 | + - each keyed member as `<object>.<container name>.<key>`, instead of `<object>.<key>`. |
| 30 | + |
| 31 | + A navigation `viewName` or a form-action `target` that used an old name to reach one of these views now reaches the shipping package's view. Use the new name instead. |
0 commit comments