@protobase/cli 0.55.6 → 0.55.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.55.6";
2
+ var version = "0.55.7";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.55.6",
3
+ "version": "0.55.7",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -42,12 +42,12 @@
42
42
  "dependencies": {
43
43
  "@better-auth/core": "^1.7.12",
44
44
  "@hono/node-server": "^2.1.3",
45
- "@protobase/config": "0.55.6",
46
- "@protobase/layout": "0.55.6",
47
- "@protobase/query": "0.55.6",
48
- "@protobase/schema": "0.55.6",
49
- "@protobase/server": "0.55.6",
50
- "@protobase/ui": "0.55.6",
45
+ "@protobase/config": "0.55.7",
46
+ "@protobase/layout": "0.55.7",
47
+ "@protobase/query": "0.55.7",
48
+ "@protobase/schema": "0.55.7",
49
+ "@protobase/server": "0.55.7",
50
+ "@protobase/ui": "0.55.7",
51
51
  "@react-email/render": "^2.1.0",
52
52
  "@scalar/hono-api-reference": "^0.12.10",
53
53
  "@tailwindcss/vite": "^4.3.3",
@@ -165,7 +165,7 @@ export const operations = resource('operations')
165
165
  - **`update` follows the parent's own parents**, so with VMs under `.parent((r) => r.folder_id, 'update')` an operation needs update on the VM's folder too. A write that would put a record under itself, or under a cycle already in the data, is refused. A `read` parent is followed only as far as reading it does (below).
166
166
  - **`read` also narrows every read.** With `.parent((r) => r.channel_id, 'read')`, a caller reads only the messages of channels they read: lists, `:search` and `:seek`, their counts, facets, charts and aggregates, a get (`404` outside, as for a row filter), relation labels, history, comments and reveals, through `/api/v1`, its batches and MCP, and the deliveries of a [subscription](webhooks.md#subscription) that runs as a role. The parent is read with the caller's own tenant, row filter and soft delete there, and its own `read` parents, so a channel whose members are listed in a `member_ids` JSON field with the read rule `where.or(where.eq('kind', 'public'), where.has('member_ids', ctx.user.id))` keeps its messages to its members, and taking someone off `member_ids` hides them on the next read. A message with a null `channel_id` names no channel and stays visible under its own rules, so a message with two nullable parents, `channel_id` or `direct_message_id`, keeps to the one it names.
167
167
  - **One indexed subquery.** The narrowing is `channel_id in (select id from channels where <the caller's channel filter>)` ANDed into the child's query (`channel_id is null or ...` for a nullable relation), so the [scan guard](api.md#safety) needs an index on `channel_id` and indexes serving the columns of the parent's row filter, such as a GIN index on `member_ids`, and `protobase doctor` names a missing index on the relation.
168
- - **A parent whose read rule reads the record hides its children.** Such a rule is no filter a query can hold, so a caller whose read rule on the parent needs the record, or who cannot read the parent resource, reads only the children with a null relation. <gap>A child under a parent whose read rule reads the record cannot be read because checking the parent per record is not implemented.</gap> Make the parent's read rule return a row filter instead. A resource that is its own parent, such as a folder tree, is checked one level up: a folder needs its parent folder readable. <gap>A record of a tree cannot keep to every ancestor because a transitive parent check is not implemented.</gap>
168
+ - **A parent whose read rule reads the record hides its children.** Such a rule is no filter a query can hold, so a caller whose read rule on the parent needs the record, or who cannot read the parent resource, reads only the children with a null relation. <gap>A child under a parent whose read rule reads the record cannot be read because checking the parent per record is not implemented.</gap> Make the parent's read rule return a row filter instead. A resource that is its own parent, such as a folder tree, is checked one level up: a folder needs its parent folder readable, and that folder is read with its other `read` parents too. So a reply under `.parent((r) => r.thread_id, 'read')` and `.parent((r) => r.channel_id, 'read')` whose `channel_id` is null keeps to the channel of the message it answers. <gap>A record of a tree cannot keep to every ancestor because a transitive parent check is not implemented.</gap>
169
169
  - **Across organizations, the session's own only.** <gap>A list across organizations cannot read a resource with a `read` parent beyond the session's own organization because resolving the parent in each organization is not implemented.</gap> The server warns at startup and lists the session's organization alone.
170
170
  - **Several parents** are each checked with their own access, also two of one resource, such as a transfer that reads its `source_vm_id` and updates its `target_vm_id`.
171
171
  - **The parent is locked until the write commits** (`FOR NO KEY UPDATE`), so a VM handed to someone else or deleted at the same moment is waited for and checked again. That is the cost: writes of records under one parent, and through an `update` parent under one ancestor, run one after another. The server's database role needs `UPDATE` on the parent's table to take the lock. Two writes that lock the same records in opposite orders, such as two batches writing under VM A then B and B then A, can deadlock: Postgres rolls one back, which answers `409` and writes nothing, and the client sends it again.