@lotics/app-sdk 0.72.0 → 0.73.0

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.
Files changed (2) hide show
  1. package/docs/queries.md +16 -1
  2. package/package.json +1 -1
package/docs/queries.md CHANGED
@@ -121,7 +121,8 @@ Delivery-layer enrichment (applied to the response, per request):
121
121
 
122
122
  - **`files` cells** — each entry gains a presigned `url` + `thumbnail_url` (24 h TTL) and
123
123
  `size` (bytes) + `created_at`, resolved from the file object at read. Presigning is
124
- server-bounded (§10). Public apps hand out direct presigned URLs anonymous-fetchable,
124
+ server-bounded (§10) and it is per ENTRY, which is why a list that renders one thumbnail
125
+ should project the column with `limit` (§3) rather than the whole array. Public apps hand out direct presigned URLs — anonymous-fetchable,
125
126
  time-boxed. (App workflow-execute responses presign returned files the same way, so their
126
127
  URLs also work for anonymous public-app viewers — see [files.md](./files.md).)
127
128
  - **`select_member` cells** — bare member-id arrays become
@@ -199,6 +200,20 @@ indexes live (§10). `sort` entries are `{ field_key, order: "asc"|"desc", blank
199
200
  (§4), never a relabel. An uncastable combination is rejected at deploy.
200
201
  - **Project only what you render.** A bare `from_table` ships every column — including `files`
201
202
  cells with storage keys — to the client (over-exposure + the presign ceiling at scale).
203
+ - **A files column takes `limit` — bound it when the surface renders a THUMBNAIL, not the
204
+ collection.** `{ "type": "files", "output": "photo", "source": "fld_…", "limit": 1 }` returns
205
+ the first entry per cell, in stored order, cut in SQL so the rest is never read or signed.
206
+ Without it the cell yields the whole array and the response pays to resolve every entry it
207
+ will never show: a register over containers averaging 33 gate photos each resolved ~832 files
208
+ to display 25 thumbnails, within 2.4× of the response-wide presign ceiling (§10) that would
209
+ reject the query outright. The bound is per CELL and caps at `FILES_PROJECTION_MAX_LIMIT`
210
+ (10) — a row wanting more than a handful is asking for the collection, which belongs to the
211
+ record surface that opens it. It is a different axis from the query's own `limit`, which
212
+ counts ROWS; `limit` on any non-`files` column — or on a computed source, which has no cell
213
+ to bound — is rejected at deploy rather than ignored. **On a UNION, set it on every arm.**
214
+ Arms align by column name and type, and `limit` is neither, so an arm that omits it still
215
+ yields whole cells — the query stays correct and silently costs what the bound was there to
216
+ avoid.
202
217
 
203
218
  ### `filter` — predicate over derived columns
204
219
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/app-sdk",
3
- "version": "0.72.0",
3
+ "version": "0.73.0",
4
4
  "description": "Runtime SDK for Lotics custom-code apps — typed hooks, postMessage bridge, mount entry point",
5
5
  "type": "module",
6
6
  "exports": {