You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 143f4cc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(metadata-protocol): the layered read's code layer is empty for an item no package ships, whether or not a stored copy of it has been loaded into the registry (#21059)
6
+
7
+
Clause-②: no
8
+
9
+
The layered read, `GET /api/v1/meta/:type/:name/layers`, reports an item's code layer as the packaged definition, and as empty when no package ships the item and it exists only as a stored customization. For an item no package ships, it answered that correctly only until the stored copy had been loaded into the in-memory registry, for example by a restart's startup load or by a list read. After that, the code layer answered the stored copy, and the lock and provenance flags were derived from it. So the same read of the same item gave two answers, depending on what had been loaded.
10
+
11
+
The code layer now skips a stored copy the registry holds, using the tenant-authorship mark the startup load already puts on every stored copy it registers. An item no package ships has an empty code layer before and after the load, and its flags come from the stored layer both times. This includes a stored copy whose own content claims a package's provenance: a claim is not a packaged definition. The deprecated layers flag on the by-name read, `GET /api/v1/meta/:type/:name`, answers the same.
12
+
13
+
Packaged items keep their packaged code layer. An item registered at runtime with no package keeps its code layer, as before. The stored rows are not changed.
fix(lint): a liveness finding's fix text is the row's `authorHint`, else the verdict's default hint, and never the row's internal ledger `note`, for every row class. Before this, a row that opted in with `authorWarn`, and an `experimental` row, with no `authorHint` printed its `note` as the fix text: on `app-showcase`, the two `liveness-planned-property` findings for `externalSharingModel` printed a 728-character maintainer note that cites a tracker id. They now print "Keep it — a consumer is being built against this property; it has no runtime effect yet." No rule id, message, severity or exit code changes, and a row that has an `authorHint` prints it exactly as before (#21096)
Copy file name to clipboardExpand all lines: packages/drivers/driver-turso/README.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,6 @@ table lists the ones that answer differently from local mode.
130
130
| Operation | Refused call | Use instead |
131
131
|:---|:---|:---|
132
132
| Transactions |`beginTransaction()`, `commit()`, `rollback()` (and their deprecated aliases `commitTransaction()` and `rollbackTransaction()`), and `options.transaction` passed to any `RemoteTransport` method in the tree above, to `aggregate()` or to `syncSchemasBatch()`| The local or embedded-replica transport, which run Knex transactions and honour `options.transaction`|
133
-
| Record numbers |`create()`, `bulkCreate()`, and an `upsert()` with no `id`, `_id` or `conflictKeys`, when a row leaves an `autonumber` field empty (`undefined`, `null` or `''`) | The local or embedded-replica transport, which generate record numbers, or a value you supply, which is written unchanged |
134
133
| Deferring schema DDL |`setDeferredDdl(true)`, which `os migrate plan` calls. `setDeferredDdl(false)` is accepted | Run the command against a local SQLite copy of the database (a `file:` URL) |
135
134
| Schema drift detection |`detectManagedDrift()`|`os migrate plan` against a local SQLite copy of the database (a `file:` URL) |
136
135
| Planning the ADR-0104 media column move |`planMediaColumnMove()`, the column step of `os migrate files-to-references`| The local or embedded-replica transport, which plan it |
@@ -147,18 +146,30 @@ table lists the ones that answer differently from local mode.
147
146
reads that and does not call `beginTransaction()`: it runs the callback with
148
147
no transaction and logs a warning once per datasource, or, called with
149
148
`require: true`, throws `TransactionUnsupportedError` before the callback runs.
150
-
-**Record numbers.** Remote mode never generates one. The check uses the
151
-
`autonumber` fields this driver recorded when it synced the object's schema
152
-
(`syncSchema`, `syncSchemasBatch` or `initObjects`). An `upsert()` that
153
-
carries an `id`, `_id` or `conflictKeys` is not refused, because it may merge
154
-
into an existing row. If it inserts instead, the row is written with the field
155
-
empty and the driver logs a warning naming the row.
156
149
-**Aggregation.**`aggregate()` called on the driver directly also refuses,
157
150
with the same code, a `groupBy` entry that has a `dateGranularity`, and an
158
151
`aggregations` entry with a non-empty `filter`. `engine.aggregate()` never
159
152
sends either one to this driver: it fetches the rows and computes both in
160
153
memory. The local transport also refuses a per-aggregation `filter`.
161
154
155
+
#### Record numbers in remote mode
156
+
157
+
An `autonumber` field a row leaves empty (`undefined`, `null` or `''`) is
158
+
filled in remote mode as it is in local and embedded-replica mode: `create()`,
159
+
`bulkCreate()` and `upsert()` issue the next value from the persistent
160
+
`_objectstack_sequences` counter, rendered with the field's `autonumberFormat`
161
+
(or `format`) and scoped per organization, per date token and per `{field}`
162
+
token exactly as `SqlDriver` scopes it. The counter moves in one statement over
163
+
the connection (`UPDATE … RETURNING`; on a cold counter, a bootstrap from the
164
+
table's highest existing value followed by `INSERT … ON CONFLICT DO UPDATE …
165
+
RETURNING`), so two processes writing to one database never draw the same
166
+
number. A row that already carries a value keeps it (a seed replay or an
167
+
import); an `upsert()` that merges into an existing row keeps the number
168
+
already in the row. A `_objectstack_sequences` table in the legacy shape
169
+
(created by a local-mode driver older than the `key_hash` column) is refused
170
+
with `code: 'DATABASE_ERROR'` / `status: 500` and the remedy in the message;
171
+
remote mode does not migrate it.
172
+
162
173
Answered in remote mode, differently from local mode:
163
174
164
175
-**`distinct()`** runs a `SELECT DISTINCT` on the remote database and answers
0 commit comments