@protobase/cli 0.119.1 → 0.119.2

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.119.1";
2
+ var version = "0.119.2";
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.119.1",
3
+ "version": "0.119.2",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.119.1",
47
- "@protobase/layout": "0.119.1",
48
- "@protobase/query": "0.119.1",
49
- "@protobase/schema": "0.119.1",
50
- "@protobase/server": "0.119.1",
51
- "@protobase/ui": "0.119.1",
52
- "@protobase/workflows": "0.119.1",
46
+ "@protobase/config": "0.119.2",
47
+ "@protobase/layout": "0.119.2",
48
+ "@protobase/query": "0.119.2",
49
+ "@protobase/schema": "0.119.2",
50
+ "@protobase/server": "0.119.2",
51
+ "@protobase/ui": "0.119.2",
52
+ "@protobase/workflows": "0.119.2",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -8,7 +8,7 @@ React to changes, deliver them to other systems, and run work in the background.
8
8
  - [Change capture](../reference/events.md#how-changes-are-captured): Every change is captured in the database, in the same transaction, whoever made it.
9
9
  - [Webhooks](../reference/webhooks.md#subscription): Events are sent to a URL, an API function or your own code, filtered by event, condition and tenant.
10
10
  - [Signed webhooks](../reference/webhooks.md#what-a-receiver-gets): Deliveries are signed under the Standard Webhooks spec.
11
- - [Delivery retries](../reference/webhooks.md#delivery-and-retries): Failed deliveries are retried for about three days.
11
+ - [Delivery retries](../reference/webhooks.md#delivery-and-retries): Each delivery is a background job of its own, so a slow receiver never holds back live updates or other deliveries; failed ones are retried for about three days.
12
12
  - [Webhooks in the admin app](../reference/webhooks.md#subscriptions-in-the-admin-app): Users create subscriptions, send test events and resend failures in the app.
13
13
  - [Webhook delivery log](../reference/webhooks.md#subscriptions-in-the-admin-app): Every try of the admin app's subscriptions, successes too, is kept for 30 days with its status and timing, when the app turns it on.
14
14
  - [Background jobs](../reference/jobs.md#enqueueing): Jobs are kept in the app's own Postgres and can be queued in the same transaction as a write, also from SQL.
@@ -81,7 +81,7 @@ Filters use the language of [access rules](access.md) and views, on any field, f
81
81
 
82
82
  `protobase migration` adds a `changes` schema to the database, with:
83
83
 
84
- - **`changes.outbox`**, one row per changed row, written in the writer's transaction, so it commits or rolls back with the change. A dispatch job reads the committed rows and deletes them once their events are delivered or queued.
84
+ - **`changes.outbox`**, one row per changed row, written in the writer's transaction, so it commits or rolls back with the change. A dispatch job reads the committed rows and deletes them in the transaction that queues their deliveries, each a job of its own.
85
85
  - **`changes.capture()`**, the trigger function. It runs as its owner, with a fixed search path, so a role that writes the table needs no rights on `changes`: another service writing as its own role keeps working once a resource has events.
86
86
  - **Two triggers per resource with events, history, [live updates](live.md) or [derived values](derived.md), or read by a derived value**, on its table: `<table>_changes` for inserts and deletes, and `<table>_changes_update` for updates that change the row.
87
87
 
@@ -90,13 +90,13 @@ A function target is called as the subscription's `as`, so `context.caller()` an
90
90
 
91
91
  ## Delivery and retries
92
92
 
93
- - **The first try** goes out from the dispatch job, right after the write: within milliseconds for a write through the API, within two seconds for one from elsewhere.
94
- - **A failed try** becomes a `webhooks.deliver` job, retried on the Standard Webhooks schedule with up to 10% jitter: 5 s, 5 m, 30 m, 2 h, 5 h, 10 h, 14 h, 20 h and 24 h, 10 tries over about three days. A `Retry-After` header makes the wait longer, up to a day.
93
+ - **Every delivery is a job of its own:** the dispatch job queues a `webhooks.deliver` job for each delivery, in the transaction that writes the change's history and live notices, and tries none itself, so a slow receiver never holds back a live update or another delivery. A worker makes the first try right after the write: within milliseconds for a write through the API, within two seconds for one from elsewhere.
94
+ - **A failed try** queues the next `webhooks.deliver` job, retried on the Standard Webhooks schedule with up to 10% jitter: 5 s, 5 m, 30 m, 2 h, 5 h, 10 h, 14 h, 20 h and 24 h, 10 tries over about three days. A `Retry-After` header makes the wait longer, up to a day.
95
95
  - **`410 Gone`** fails the delivery at once.
96
96
  - **After the last try** the job is kept as failed, on the [failed jobs page](jobs.md#failed-jobs-page), where it can be retried.
97
- - **Ordered subscriptions** get no first try from the dispatch job: a `webhooks.deliver-ordered` job delivers a record's events of one dispatch in order, retried with doubling waits from 5 s up to a day, 10 tries. Meanwhile the record's later events to that subscription wait. A retry sends again the events of that job that went through before the one that failed.
97
+ - **Ordered subscriptions** get one `webhooks.deliver-ordered` job instead: it delivers a record's events of one dispatch in order, retried with doubling waits from 5 s up to a day, 10 tries. Meanwhile the record's later events to that subscription wait. A retry sends again the events of that job that went through before the one that failed.
98
98
  - **Every retry and resend follows the subscription as it is now:** its event leaves out fields that became sensitive since it was first made, and a subscription with `as` roles that may no longer read the record gets nothing. <gap>A retry of a thin event cannot check the row rules of `as` roles again because reading the current record for it is not implemented.</gap>
99
- - **At least once:** a process that stops after delivering but before recording it delivers again when the dispatch job is retried, under the same `webhook-id`.
99
+ - **At least once:** a process that stops after delivering but before recording it delivers again when its delivery job is retried, under the same `webhook-id`.
100
100
  - **Event code that throws**, such as a `match` that reads a field it did not expect to be empty, a subscription's `when` or an access rule of its `as` roles, keeps that change as a failed `webhooks.dispatch-change` job on the failed jobs page, naming the event or subscription and the error, and dispatch moves on to later changes. Retry it once the code is fixed to deliver the change's events. An access rule of `as` roles keeps the change as failed for that subscription only: the other subscriptions still receive it, and the retry delivers it to that subscription alone. A database error instead fails the whole dispatch job, which is retried.
101
101
 
102
102
  Every outcome is a line in the server log, such as `webhook newOrdersToSlack orders.created evt_48211_created delivered (200)`.