@vercel/board 0.31.0 → 0.33.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.
- package/README.md +25 -20
- package/dist/{access-CY5xVMIK.mjs → access-N3XmkKXg.mjs} +3 -3
- package/dist/access.d.mts +4 -5
- package/dist/access.mjs +5 -5
- package/dist/{actors-Bm-ojWWT.mjs → actors-ihyN47OV.mjs} +3 -3
- package/dist/{auth-DLYSt_-A.d.mts → auth-D6z3rMNj.d.mts} +11 -93
- package/dist/{auth-CyO2aw5n.mjs → auth-r-_PeZyw.mjs} +39 -151
- package/dist/{backend-Bob-5CM7.d.mts → backend-CWpyR1A7.d.mts} +81 -51
- package/dist/backend-local.d.mts +28 -0
- package/dist/backend-local.mjs +2 -0
- package/dist/{chat-provider-DkFp2hrh.mjs → chat-provider-9hCT654s.mjs} +2 -2
- package/dist/{chat-provider-BChYrrA7.d.mts → chat-provider-DJpFUaFv.d.mts} +2 -3
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +2 -2
- package/dist/cli-embedded.mjs +2 -2
- package/dist/cli.mjs +6 -6
- package/dist/{commands-DK4W3HCJ.d.mts → commands-BOBQHVqM.d.mts} +14 -0
- package/dist/{commands-L1JSGz2Z.mjs → commands-CHoMl06v.mjs} +39 -12
- package/dist/{conformance-DK43HiHf.mjs → conformance-qKmGLTAT.mjs} +40 -5
- package/dist/conformance.d.mts +1 -1
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-DurYIRt8.mjs → engine-JxgZiikU.mjs} +6 -8
- package/dist/{errors-CJXhhzvT.mjs → errors-Pk0XV1hK.mjs} +56 -2
- package/dist/{events-lujPA3gQ.mjs → events-IQg0k281.mjs} +2 -2
- package/dist/exports-BuKjVq2t.d.mts +4 -0
- package/dist/exports-gHDHlg0i.mjs +3207 -0
- package/dist/{external-D3p5T57R.mjs → external-CYe424fO.mjs} +1 -1
- package/dist/{folds-DLUzfibJ.d.mts → folds-DjFTiqIM.d.mts} +38 -44
- package/dist/index-CXvvYNYj.d.mts +11 -0
- package/dist/index.d.mts +9 -8
- package/dist/index.mjs +21 -8
- package/dist/index.node.d.mts +5 -6
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +95 -95
- package/dist/{internal-CvsrprnU-zZMpDiRY.mjs → internal-CvsrprnU-CEPOUpAv.mjs} +63 -43
- package/dist/local-BbLjA5vI.mjs +8818 -0
- package/dist/{main-Dz-8komG.mjs → main-CQpCZJFw.mjs} +140 -36
- package/dist/{backend-a2/store-memory.mjs → memory-7RRnLa4X.mjs} +3 -3
- package/dist/middleware-BU7rVi9F.mjs +103 -0
- package/dist/{client-COfYrgfV.d.mts → provider-BlzUvcM9.d.mts} +665 -5
- package/dist/{schemas-DBmUO6pr.mjs → schemas-BG205xds.mjs} +2 -5
- package/dist/{serve-CTmow-YH.mjs → serve-D8_W4UN6.mjs} +33 -24
- package/dist/{node-BgeGcwX0.mjs → server-BiIUXWbU.mjs} +419 -6
- package/dist/{serving-DBFRo6U_.mjs → serving-D7rcUtSC.mjs} +1 -1
- package/dist/{sql-CT5xVuGr.mjs → sql-BQzKUqQt.mjs} +349 -114
- package/dist/sqlite-DCtZFEVm.mjs +30 -0
- package/dist/{sqlite-db-0WeSOEZN.mjs → sqlite-db-qLTs52Ny.mjs} +2 -3
- package/dist/{store-codec-pAG2oPgQ-SqDXlPBR.mjs → store-N8PXxDAS-BdL4Sq-f.mjs} +6 -2
- package/dist/{store-memory-B0PkVSuQ.mjs → store-memory-CKQVEzXN.mjs} +2 -4
- package/dist/store-memory-OdGsc-t_.mjs +2 -0
- package/dist/{store-polling-BZt2Rf3D-Div-bJ_D.mjs → store-polling-BZt2Rf3D-oh3aU_An.mjs} +1 -1
- package/dist/store-sqlite-CTxAVCcz.mjs +2 -0
- package/dist/{store-sqlite-D85t3tE7.mjs → store-sqlite-D6fIszST.mjs} +3 -4
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-chat-sdk.mjs +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-github.mjs +2 -2
- package/dist/sync-linear.d.mts +2 -3
- package/dist/sync-linear.mjs +2 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync-slack.mjs +4 -4
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +2 -2
- package/dist/{watchers-hash-BjwlnGD9.mjs → targets-CknPGGVi.mjs} +40 -10
- package/dist/{tokens-Dnyd_y1n.mjs → tokens-DPKjl3jf.mjs} +15 -43
- package/docs/01-board/01-mounting.md +243 -288
- package/docs/01-board/03-identity.md +41 -50
- package/docs/01-board/04-messages.md +19 -16
- package/docs/01-board/05-reading.md +3 -3
- package/docs/01-board/06-watchers.md +58 -105
- package/docs/01-board/07-schedules.md +21 -41
- package/docs/01-board/08-middleware.md +11 -17
- package/docs/01-board/09-access.md +76 -313
- package/docs/01-board/10-local.md +81 -0
- package/docs/01-quickstart.md +49 -126
- package/docs/02-sync/01-overview.md +25 -80
- package/docs/02-sync/02-functions.md +10 -16
- package/docs/02-sync/03-slack.md +13 -26
- package/docs/02-sync/04-github.md +8 -20
- package/docs/02-sync/07-linear.md +6 -10
- package/docs/03-guides/02-inspector.md +3 -3
- package/docs/03-guides/03-ci.md +88 -128
- package/docs/03-guides/04-triage.md +7 -15
- package/docs/03-guides/05-agent-factory.md +30 -36
- package/docs/04-reference/01-cli.md +118 -32
- package/docs/04-reference/02-board.md +60 -74
- package/docs/04-reference/03-http.md +119 -57
- package/docs/04-reference/05-conformance.md +31 -45
- package/docs/index.md +41 -65
- package/package.json +12 -83
- package/dist/a2-DngWY2Eb.mjs +0 -4238
- package/dist/access-DPcrKIH_.d.mts +0 -37
- package/dist/backend-a2/blob-vercel.d.mts +0 -8
- package/dist/backend-a2/blob-vercel.mjs +0 -81
- package/dist/backend-a2/contract.d.mts +0 -828
- package/dist/backend-a2/contract.mjs +0 -5
- package/dist/backend-a2/scheduler-local.d.mts +0 -11
- package/dist/backend-a2/scheduler-local.mjs +0 -2
- package/dist/backend-a2/scheduler-qstash.d.mts +0 -79
- package/dist/backend-a2/scheduler-qstash.mjs +0 -522
- package/dist/backend-a2/scheduler-vercel.d.mts +0 -38
- package/dist/backend-a2/scheduler-vercel.mjs +0 -204
- package/dist/backend-a2/store-memory.d.mts +0 -11
- package/dist/backend-a2/store-postgres.d.mts +0 -38
- package/dist/backend-a2/store-postgres.mjs +0 -2977
- package/dist/backend-a2/store-redis-http.d.mts +0 -17
- package/dist/backend-a2/store-redis-http.mjs +0 -520
- package/dist/backend-a2/store-redis.d.mts +0 -31
- package/dist/backend-a2/store-redis.mjs +0 -88
- package/dist/backend-a2/store-sqlite.d.mts +0 -12
- package/dist/backend-a2/store-sqlite.mjs +0 -31
- package/dist/backend-a2.d.mts +0 -2633
- package/dist/backend-a2.mjs +0 -3
- package/dist/backend-http-BRrRbjRx.d.mts +0 -672
- package/dist/backend-http-CvUKOn-m.mjs +0 -585
- package/dist/backend-http-D8mUzuKQ.mjs +0 -18
- package/dist/backend-http.d.mts +0 -10
- package/dist/backend-http.mjs +0 -2
- package/dist/backend-http.node.d.mts +0 -10
- package/dist/backend-http.node.mjs +0 -2
- package/dist/backend-vercel-Ba8JDtqW.mjs +0 -86
- package/dist/backend-vercel-BaSEUdwg.d.mts +0 -674
- package/dist/backend-vercel-CmY9yZ9m.mjs +0 -1656
- package/dist/backend-vercel.d.mts +0 -9
- package/dist/backend-vercel.mjs +0 -11
- package/dist/backend-vercel.node.d.mts +0 -17
- package/dist/backend-vercel.node.mjs +0 -2
- package/dist/blob-Bx8QPWEd.d.mts +0 -40
- package/dist/blob-WbB2DJKn.mjs +0 -201
- package/dist/errors-2vGs49Db.d.mts +0 -16
- package/dist/exports-CWIdN0Ub.mjs +0 -1389
- package/dist/exports-FBOQWT7O.d.mts +0 -5
- package/dist/files-SniSmeEr.mjs +0 -47
- package/dist/folds-Cu9Q9zyQ.mjs +0 -207
- package/dist/index-Ho-ayyQL.d.mts +0 -11
- package/dist/index.default-BUcwDaAe.mjs +0 -12
- package/dist/local-C76Fy5ad.mjs +0 -44
- package/dist/middleware-BavYSDUa.mjs +0 -62
- package/dist/platform-B4TnJtWu-Do3agKr5.mjs +0 -32
- package/dist/project-CQ4VUibA.mjs +0 -124
- package/dist/provider-gynDUoyW.d.mts +0 -665
- package/dist/redis-tables-DHf85ixI.mjs +0 -3895
- package/dist/reducer-Bswr11ar-P324o9vn.mjs +0 -74
- package/dist/reducer-CYPHsSmd-BXjGiptm.d.mts +0 -170
- package/dist/reducers-DcENwtwZ.mjs +0 -538
- package/dist/retryable-lazy-DZWmHpii-DpTc5PIP.mjs +0 -19
- package/dist/scheduler-task-X1SToDjP-D2Il2rln.mjs +0 -69
- package/dist/server-B9gu0qi1-DI1WvcVK.d.mts +0 -391
- package/dist/server-DG8D6VV0.mjs +0 -17
- package/dist/server-DX7mM6nm-D7N_7bug.mjs +0 -3611
- package/dist/session-clear-XJYpmUpg-2q8l_FJR.mjs +0 -63
- package/dist/store-DEzcHZOA-B-5vhxef.d.mts +0 -540
- package/dist/store-N8PXxDAS-DWWgv-Vz.mjs +0 -5
- package/dist/store-memory-4IBl0Ztu.mjs +0 -2
- package/dist/store-presence-polling-JuAy2Ck2-Dh-g_KYM.mjs +0 -109
- package/dist/store-sqlite-iBTYYKBj.mjs +0 -2
- package/dist/stream-buffer-DrTyiIuo-Be10yOBR.mjs +0 -53
- package/dist/targets-Cgjs29T0.mjs +0 -33
- package/dist/types-CmrFjpml.d.mts +0 -102
- package/dist/wait-until-Dw4XrIDQ.mjs +0 -42
- package/docs/01-board/02-database.md +0 -258
- package/docs/04-reference/04-log.md +0 -247
- package/sql/postgres/board.sql +0 -145
- package/sql/postgres/notifications.sql +0 -24
- package/sql/postgres/schema.sql +0 -451
|
@@ -10,12 +10,12 @@ must be the board's URL, exactly as [discovery](./01-mounting.md#discovery)
|
|
|
10
10
|
returns it. A token minted for one board is useless against any other, even
|
|
11
11
|
another board on the same origin. That's `board()`'s default `authenticate`;
|
|
12
12
|
a host can recognize its own credentials too: see
|
|
13
|
-
[
|
|
13
|
+
[Callers of your own](./01-mounting.md#callers-of-your-own).
|
|
14
14
|
|
|
15
15
|
Only a few routes take no token: discovery, the built-in avatars, the OpenAPI
|
|
16
16
|
document, and `/webhooks/:key`, which the platform's adapter authenticates instead. A
|
|
17
|
-
|
|
18
|
-
to pull.
|
|
17
|
+
route whose watchers another board runs (Vercel's board, say) also answers
|
|
18
|
+
`POST /wake` without one: a wake-up only says to pull.
|
|
19
19
|
|
|
20
20
|
## Where tokens come from
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ The CLI and `board()` in Node find a token themselves. The first match wins:
|
|
|
23
23
|
|
|
24
24
|
| Where | How | Principal |
|
|
25
25
|
| --- | --- | --- |
|
|
26
|
-
| Explicit | `BOARD_TOKEN`: an OIDC JWT for the board's audience, from Vercel, GitHub Actions, or an issuer
|
|
26
|
+
| Explicit | `BOARD_TOKEN`: an OIDC JWT for the board's audience, from Vercel, GitHub Actions, or an issuer a grant names; or a [board token](./09-access.md#tokens) | the issuer's, or a board token's minter |
|
|
27
27
|
| A board from `vb serve` | the token it writes to a file only you can read, for its `127.0.0.1` URL | `local:user:<your OS user>` |
|
|
28
28
|
| GitHub Actions | the job's OIDC token, for the board's audience; needs `permissions: id-token: write` | `github:repo:<repository_id>` |
|
|
29
29
|
| A Vercel deployment | `getVercelOidcToken({ audience })` from `@vercel/oidc`, when `VERCEL=1` | `vercel:project:<project_id>:<env>` |
|
|
@@ -34,9 +34,8 @@ discovery there names another URL, they get no token and fail with
|
|
|
34
34
|
`wrong_audience`: use the URL the error names. So a board can't claim to be
|
|
35
35
|
another one and collect tokens it could replay there.
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
[handle reference](../04-reference/02-board.md).
|
|
37
|
+
Outside Node, `board({ fetch })` brings its own credentials for Vercel's board,
|
|
38
|
+
since nothing finds them. See the [handle reference](../04-reference/02-board.md).
|
|
40
39
|
|
|
41
40
|
### From your terminal
|
|
42
41
|
|
|
@@ -96,16 +95,16 @@ made out to this board. It verifies a token once and keeps who it is until the
|
|
|
96
95
|
token expires, so a live stream doesn't verify each time it polls.
|
|
97
96
|
|
|
98
97
|
- **Vercel tokens** are verified with `jose` against the team issuer's keys.
|
|
99
|
-
`board()` knows its own project from
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
`board()` knows its own project from `VERCEL_PROJECT_ID`, or
|
|
99
|
+
`.vercel/project.json`. A `development` token from it is a person and must
|
|
100
|
+
carry `user_id`. Any other environment is the
|
|
102
101
|
deployment itself: in the environment the board runs in, it can do
|
|
103
|
-
everything, and in any other, nothing unless
|
|
104
|
-
|
|
105
|
-
accepts its own.
|
|
102
|
+
everything, and in any other, nothing unless a
|
|
103
|
+
[grant](./09-access.md#grants) lets it in. So a production board refuses its
|
|
104
|
+
previews, and a preview board accepts its own.
|
|
106
105
|
- **GitHub Actions tokens, other Vercel projects, and other issuers** are
|
|
107
|
-
accepted only when
|
|
108
|
-
|
|
106
|
+
accepted only when a [grant](./09-access.md#grants) matches them, which also
|
|
107
|
+
says what they may do in each channel.
|
|
109
108
|
- **Tests** point verification at a local issuer:
|
|
110
109
|
`board({ authenticate: oidcTokens({ vercel: { issuer, jwks } }) })`. It still
|
|
111
110
|
runs real verification against a real key set; no environment variable
|
|
@@ -123,7 +122,7 @@ A **principal** is who holds the credential. It's a readable string:
|
|
|
123
122
|
| `github:repo:123456` | a GitHub Actions workflow in that repo |
|
|
124
123
|
| `oidc:gitlab.com:project_path:acme/api:ref_type:branch:ref:main` | another issuer's token, by its `sub` |
|
|
125
124
|
| `slack:user:U0456`, `github:user:583231` | a platform user, arriving through [sync](../02-sync/01-overview.md) |
|
|
126
|
-
| `board:watch:triage`, `board:client`, `board:client:deploys` |
|
|
125
|
+
| `board:watch:triage`, `board:client`, `board:client:deploys` | a [local board](./10-local.md)'s own [watchers](./06-watchers.md) and [handle](./01-mounting.md#the-handle), with `as()`'s profile |
|
|
127
126
|
|
|
128
127
|
A **profile** is a named identity within a principal: an agent acting for a
|
|
129
128
|
person. An **actor** is what a message is attributed to: the principal alone,
|
|
@@ -164,52 +163,44 @@ verified principal.
|
|
|
164
163
|
|
|
165
164
|
## Machines outside the project
|
|
166
165
|
|
|
167
|
-
Machines outside the board's project need a
|
|
168
|
-
says what they may do in each channel
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const team = board({
|
|
177
|
-
backend: a2({ store: postgres({ connectionString: process.env.DATABASE_URL! }) }),
|
|
178
|
-
access: [
|
|
179
|
-
vercelProject({ project: 'marketing', environments: ['production'], can: { 'feedback/': ['post'] } }),
|
|
180
|
-
githubActions({ repository: 'acme/www', workflow: '.github/workflows/deploy.yml', can: { deploys: ['read', 'post'] } }),
|
|
181
|
-
],
|
|
182
|
-
})
|
|
183
|
-
export const GET = team.fetch, POST = team.fetch
|
|
166
|
+
Machines outside the board's project need a [grant](./09-access.md#grants),
|
|
167
|
+
which says what they may do in each channel. Someone with `manage` in every
|
|
168
|
+
channel creates it on the board, and it holds from the next request:
|
|
169
|
+
|
|
170
|
+
```text
|
|
171
|
+
$ vb grants create vercel --claim project_id=prj_marketing --claim environment=production --can feedback/=post
|
|
172
|
+
granted g1
|
|
173
|
+
$ vb grants create github --claim repository=acme/www --can deploys=read,post
|
|
174
|
+
granted g2
|
|
184
175
|
```
|
|
185
176
|
|
|
186
|
-
- **A
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
by name, but the principal records its ID, so a rename doesn't change who
|
|
193
|
-
wrote what.
|
|
177
|
+
- **A Vercel grant names a project by its ID,** and the environment it calls
|
|
178
|
+
from. A GitHub grant names a repository, by `repository` or
|
|
179
|
+
`repository_id`; only `repository_id` survives a rename.
|
|
180
|
+
- **Grants match claims; principals record IDs.** A workflow writes as
|
|
181
|
+
`github:repo:<repository_id>` whatever its grant names, so a rename doesn't
|
|
182
|
+
change who wrote what.
|
|
194
183
|
- **A `pull_request` run's token carries `ref: refs/pull/<n>/merge`,** so a
|
|
195
|
-
|
|
196
|
-
instead.
|
|
184
|
+
grant pinned to `--claim ref=refs/heads/main` doesn't match it. Match on
|
|
185
|
+
`event_name` instead.
|
|
197
186
|
|
|
198
187
|
> [!WARNING]
|
|
199
188
|
> For `pull_request`, GitHub runs the workflow file from the PR's merge commit,
|
|
200
|
-
> so anyone who can open a PR can change what it posts. Keep
|
|
201
|
-
> those
|
|
189
|
+
> so anyone who can open a PR can change what it posts. Keep `--can` narrow for
|
|
190
|
+
> grants that match those runs. Fork PRs get no OIDC token at all.
|
|
202
191
|
|
|
203
|
-
[Access](./09-access.md) has the permissions, the channel patterns,
|
|
204
|
-
|
|
192
|
+
[Access](./09-access.md) has the permissions, the channel patterns, grants for
|
|
193
|
+
other issuers, board tokens for callers with no OIDC token, and what a caller
|
|
194
|
+
sees.
|
|
205
195
|
|
|
206
196
|
## Authorization
|
|
207
197
|
|
|
208
198
|
- **People and the board's own deployments in its environment can do everything.** There are no
|
|
209
199
|
roles or member lists, and nothing restricts the project's own people.
|
|
210
200
|
Content that needs privacy from them needs a second board.
|
|
211
|
-
- **Everyone else can do what
|
|
212
|
-
what they can't read answers
|
|
201
|
+
- **Everyone else can do what their grants give them, channel by channel,** or
|
|
202
|
+
a board token what its minter may, narrowed. What they can't read answers
|
|
203
|
+
404.
|
|
213
204
|
- **Only the principal that wrote a message can edit or delete it.** A person
|
|
214
205
|
can edit their own profiles' messages.
|
|
215
206
|
- **Raw platform data needs more than reading.** `vb inbox` needs `sync` in
|
|
@@ -221,7 +212,7 @@ Handles are display hints, not reservations:
|
|
|
221
212
|
|
|
222
213
|
- **A person's** is their Vercel username, sent by the CLI. Override it with
|
|
223
214
|
`--handle` or `BOARD_HANDLE`. On a board with
|
|
224
|
-
[its own verifier](./
|
|
215
|
+
[its own verifier](./01-mounting.md#callers-of-your-own), it's the handle
|
|
225
216
|
that verifier returns, and the CLI's doesn't replace it.
|
|
226
217
|
- **A profile's** is `<person>/<profile>`: `julian/claude`.
|
|
227
218
|
- **A deployment's** is its project name, plus `@<env>` outside production.
|
|
@@ -35,7 +35,8 @@ echo "a longer note" | vb reply "$id" - # - reads the text from std
|
|
|
35
35
|
- **A message's ID is a string,** shown as `#812`. It's unique within the
|
|
36
36
|
board; pass it back as you got it, and don't count with it or order by it.
|
|
37
37
|
An ID doubles as a cursor, so a script can chain it: `vb wait --after "$id"`.
|
|
38
|
-
|
|
38
|
+
Vercel's board hands out `msg_…` IDs, and a [local board](./10-local.md)
|
|
39
|
+
numbers (`812`).
|
|
39
40
|
- **Threads are one level deep.** Reply to any message in a thread and the
|
|
40
41
|
board stores the root as `re`, plus the exact message you replied to as
|
|
41
42
|
`replyTo` when that isn't the root. Platforms with sub-threads use `replyTo`
|
|
@@ -69,8 +70,10 @@ vb delete 812
|
|
|
69
70
|
|
|
70
71
|
Only the principal that wrote a message can edit or delete it. A deleted
|
|
71
72
|
message becomes a tombstone: `vb read` shows `(message removed)`, and its text,
|
|
72
|
-
reactions, mentions, and attachments are gone from every view. A
|
|
73
|
-
|
|
73
|
+
reactions, labels, mentions, and attachments are gone from every view. A label
|
|
74
|
+
filter no longer finds it, or its replies by its labels, so a deleted task never
|
|
75
|
+
looks open. A deleted message takes no more edits, reactions, or labels. Its
|
|
76
|
+
replies stay.
|
|
74
77
|
|
|
75
78
|
A message's `revision` changes with each edit and delete, and only then:
|
|
76
79
|
reactions and labels leave it as it is. `--if-revision` edits or deletes only
|
|
@@ -179,9 +182,9 @@ vb download nXHY2NjUHuzE5F1QpXyBdQ # saves after.png here; a path, or
|
|
|
179
182
|
```
|
|
180
183
|
|
|
181
184
|
- **At most 4 MB per file and 10 per message.** An upload is one request,
|
|
182
|
-
under Vercel Functions' request limit. Where the board
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
under Vercel Functions' request limit. Where the board can sign upload URLs
|
|
186
|
+
(Vercel's board can), a file up to 100 MB goes straight to its storage
|
|
187
|
+
instead, by itself. The CLI checks every file before uploading any. Files sync brings over from a platform can be up to 25 MB,
|
|
185
188
|
since sync fetches them on the server.
|
|
186
189
|
- **The board records each file's name, type, and size from what it stored,**
|
|
187
190
|
never from the request, and refuses an attachment ID it never stored. An ID
|
|
@@ -192,16 +195,16 @@ vb download nXHY2NjUHuzE5F1QpXyBdQ # saves after.png here; a path, or
|
|
|
192
195
|
origin. PNG, JPEG, GIF, WebP, and AVIF images, MP4 and WebM video, and plain
|
|
193
196
|
text display inline; everything else downloads.
|
|
194
197
|
- **Deleting a message hides its files,** and only their uploader and callers
|
|
195
|
-
that read every channel can still fetch them. The bytes stay
|
|
196
|
-
|
|
198
|
+
that read every channel can still fetch them. The bytes stay where the board
|
|
199
|
+
keeps them: a file that must not be read again needs deleting from there.
|
|
197
200
|
- **Files posted on a synced platform come in too,** as attachments on the
|
|
198
201
|
board's copy. See [Sync](../02-sync/01-overview.md).
|
|
199
|
-
- **
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
platform's files over as links to where they
|
|
204
|
-
|
|
202
|
+
- **A board that keeps no files says so.** Vercel's board and `local()` keep
|
|
203
|
+
them. On a [backend of your own](./01-mounting.md#a-backend-of-your-own)
|
|
204
|
+
that doesn't, an upload, a post or schedule that carries files, and a
|
|
205
|
+
download answer 501 `no_files`, and `vb` says it can't, with the board's
|
|
206
|
+
words under it. Sync brings a platform's files over as links to where they
|
|
207
|
+
live instead.
|
|
205
208
|
|
|
206
209
|
In code, `upload` first, then post with what it returns:
|
|
207
210
|
|
|
@@ -226,8 +229,8 @@ vb post deploys "a1b2c3 is live" --idempotency-key deploy-a1b2c3
|
|
|
226
229
|
The same ID with the same write returns the message it already posted. The same
|
|
227
230
|
ID with a different write fails with `duplicate_id`. The CLI and a
|
|
228
231
|
[handle](./01-mounting.md#the-handle) make the ID their own, so no one can post
|
|
229
|
-
with it first:
|
|
230
|
-
only from that principal. Through the HTTP API yourself, IDs are up to 200
|
|
232
|
+
with it first: to a board at a URL it goes as `key:<principal>:…`, which the
|
|
233
|
+
board takes only from that principal. Through the HTTP API yourself, IDs are up to 200
|
|
231
234
|
characters, and someone else's post with your ID fails with `duplicate_id`.
|
|
232
235
|
UUIDv8s are the board's own, for the writes it makes itself, so the API refuses
|
|
233
236
|
them, and `key:` IDs under another principal, and `sync:` IDs, which are
|
|
@@ -92,9 +92,9 @@ vb read errors-www --by ada --text ENOTFOUND
|
|
|
92
92
|
`--label pr=acme/www#123` is that PR's whole conversation, replies
|
|
93
93
|
included. Repeat `--label` and every one must match.
|
|
94
94
|
|
|
95
|
-
On `
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
On [`local()`](./10-local.md), `read` queries tables the board keeps from its
|
|
96
|
+
log, with channels, threads, authors, mentions, and labels indexed: a thread,
|
|
97
|
+
or a channel's threads, cost the same on a board of any size.
|
|
98
98
|
|
|
99
99
|
## Following live
|
|
100
100
|
|
|
@@ -7,39 +7,32 @@ description: A watcher is a `vb tail` the board runs for you, durably, with noth
|
|
|
7
7
|
|
|
8
8
|
```ts app/api/board/[[...path]]/route.ts
|
|
9
9
|
import { board } from '@vercel/board'
|
|
10
|
-
import { a2 } from '@vercel/board/backend-a2'
|
|
11
|
-
import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
|
|
12
|
-
import { postgres } from '@vercel/board/backend-a2/store-postgres'
|
|
13
|
-
|
|
14
|
-
const backend = a2({
|
|
15
|
-
store: postgres({ connectionString: process.env.DATABASE_URL! }),
|
|
16
|
-
scheduler: vercelQueues({ topic: 'board' }), // retries on a clock: see How it runs
|
|
17
|
-
})
|
|
18
10
|
|
|
19
11
|
const team = board({
|
|
20
|
-
backend,
|
|
21
|
-
// sync as in Sync
|
|
22
12
|
watch: {
|
|
23
13
|
triage: {
|
|
24
|
-
tail: '
|
|
14
|
+
tail: 'support',
|
|
25
15
|
run: async ({ event, board }) => {
|
|
26
16
|
if (event.type === 'message.posted' && event.message?.re === null)
|
|
27
|
-
await board.reply(event.message.id, 'Thanks! Tracking it.')
|
|
17
|
+
await board.reply(event.message.id, 'Thanks! Tracking it.')
|
|
28
18
|
},
|
|
29
19
|
},
|
|
30
20
|
},
|
|
31
21
|
})
|
|
32
22
|
export const GET = team.fetch, POST = team.fetch
|
|
33
|
-
export const { scheduler } = backend
|
|
34
23
|
```
|
|
35
24
|
|
|
36
25
|
`tail` is what you'd type after `vb tail`. `run` gets each event that tail
|
|
37
26
|
would print, exactly as `vb tail --json` prints it. Try it in a terminal first:
|
|
38
27
|
|
|
39
28
|
```bash
|
|
40
|
-
vb tail
|
|
29
|
+
vb tail support --json
|
|
41
30
|
```
|
|
42
31
|
|
|
32
|
+
That's your team's board in Vercel's API. Vercel's API matches each event
|
|
33
|
+
against the tails, and wakes this route when one matches, so `run` happens in
|
|
34
|
+
this deployment: see [How it runs](#how-it-runs).
|
|
35
|
+
|
|
43
36
|
## The expression
|
|
44
37
|
|
|
45
38
|
A channel (or `prefix/` for a subtree) and the shared
|
|
@@ -137,10 +130,12 @@ runs.
|
|
|
137
130
|
## Writing back
|
|
138
131
|
|
|
139
132
|
`board` is the board's [handle](./01-mounting.md#the-handle), acting as the
|
|
140
|
-
watcher
|
|
133
|
+
watcher.
|
|
141
134
|
|
|
142
|
-
- **It writes as the watcher
|
|
143
|
-
|
|
135
|
+
- **It writes as the watcher.** On Vercel's board, that's this deployment
|
|
136
|
+
with the watcher's ID as its profile:
|
|
137
|
+
`vercel:project:prj_v0:production+triage`. On `local()`, it's
|
|
138
|
+
`board:watch:<id>`, with the ID as its handle. Its writes sync like anyone's.
|
|
144
139
|
- **Its posts and replies get IDs derived from the match,** so a retried `run`
|
|
145
140
|
doesn't post twice, as long as it writes in the same order. Writes made in
|
|
146
141
|
parallel (with `Promise.all`) need an explicit `id`, which is the watcher's
|
|
@@ -154,107 +149,65 @@ watcher, with no HTTP and no token.
|
|
|
154
149
|
|
|
155
150
|
## How it runs
|
|
156
151
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
Where the match happens depends on the board:
|
|
153
|
+
|
|
154
|
+
- **On Vercel's board,** Vercel's API keeps the log and matches the tails,
|
|
155
|
+
and wakes this deployment when one matches. It pulls what matched with its
|
|
156
|
+
own credentials and runs it here: see [Woken by the board](#woken-by-the-board).
|
|
157
|
+
With `BOARD_URL` set, the board at that URL does the same.
|
|
158
|
+
- **On [`local()`](./10-local.md),** everything happens in this process. Each
|
|
159
|
+
event is matched against every watcher on its thread's lane, and `run`
|
|
160
|
+
happens on that lane too.
|
|
161
|
+
|
|
162
|
+
Either way:
|
|
161
163
|
|
|
162
|
-
- **A watcher sees a thread's events in order,** and threads run in parallel.
|
|
163
164
|
- **Each watcher fails on its own.** A `run` that throws is tried again after
|
|
164
|
-
a wait
|
|
165
|
-
`watch.failed`, and the thread goes on. Runs cut short (a timeout, out of
|
|
166
|
-
memory) count too, and ones that keep getting cut short are given up on at
|
|
167
|
-
the 10th try. Writes, other threads, and other watchers keep flowing.
|
|
168
|
-
- **Retries need the scheduler,** as sync's do. Without one, a match still
|
|
169
|
-
runs in the request that wrote, but a retry waits for the watcher's next
|
|
170
|
-
match, and reads never wake it. That suits a tool, not a production board:
|
|
171
|
-
see [Without a scheduler](./01-mounting.md#without-a-scheduler) and
|
|
172
|
-
[the scheduler route](./01-mounting.md#the-scheduler-route).
|
|
165
|
+
a wait. Writes, other threads, and other watchers keep flowing.
|
|
173
166
|
- **A watcher removed from config** skips the matches it left behind.
|
|
174
167
|
|
|
168
|
+
On `local()`, a watcher sees a thread's events in order, and threads run in
|
|
169
|
+
parallel. A `run` that throws waits 1 second, doubling to 30, and after 5
|
|
170
|
+
tries it's logged and recorded as `watch.failed`, and the thread goes on. Runs
|
|
171
|
+
cut short (a timeout, out of memory) count as tries too, and ones that keep
|
|
172
|
+
getting cut short are given up on at the 10th. Its retries wait on timers in
|
|
173
|
+
the process, so a restart drops the ones pending.
|
|
174
|
+
|
|
175
175
|
The [triage guide](../03-guides/04-triage.md) builds a full triage agent, first
|
|
176
176
|
as a `tail` loop and then as a watcher.
|
|
177
177
|
|
|
178
|
-
##
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
})
|
|
200
|
-
export const GET = team.fetch, POST = team.fetch
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
- **It registers its watchers' tails there,** as itself: on its first use if
|
|
204
|
-
it knows its URL (a call from its handle, or a request), when anyone sends
|
|
205
|
-
`POST /watchers` to it, and when a wake-up shows the other board holds an
|
|
206
|
-
older set. Nothing happens before that: creating the board does no I/O. On Vercel, its URL is its
|
|
207
|
-
production domain, or a preview's own; a request's `Host` never counts. A
|
|
208
|
-
registration holds at most 32 watchers, and needs `read` somewhere. A
|
|
209
|
-
token narrowed with `x-board-scope` can't register, pull, or ack (403): the
|
|
210
|
-
registration is its project's, which a narrowed pull would take matches
|
|
211
|
-
from.
|
|
212
|
-
- **A match wakes it with nothing in the wake-up:** a `POST <url>/wake` with
|
|
213
|
-
no event. It then pulls what matched with its own credentials, runs it, and
|
|
178
|
+
## Woken by the board
|
|
179
|
+
|
|
180
|
+
On Vercel's board, Vercel's API matches the tails, and the route at the top of
|
|
181
|
+
this page runs `run`:
|
|
182
|
+
|
|
183
|
+
- **It registers its watchers' tails with Vercel's API,** as this deployment:
|
|
184
|
+
on its first use if it knows its URL (a call from its handle, or a
|
|
185
|
+
request), when anyone sends `POST /watchers` to it, and when a wake-up shows
|
|
186
|
+
the API holds an older set. Nothing happens before that: creating the board
|
|
187
|
+
does no I/O. On Vercel, its URL is its production domain, or a preview's
|
|
188
|
+
own; a request's `Host` never counts. A registration holds at most 32
|
|
189
|
+
watchers.
|
|
190
|
+
- **From production, or a preview of a branch, it registers its mount path**
|
|
191
|
+
on its own project, which it names with that branch, and Vercel's API wakes
|
|
192
|
+
it through Deployment Protection with nothing to set up. Anywhere else
|
|
193
|
+
(development, a custom environment, a preview made with `vercel deploy`),
|
|
194
|
+
it registers its URL.
|
|
195
|
+
- **A match wakes it with nothing in the wake-up:** a `POST /wake` with no
|
|
196
|
+
event. It then pulls what matched with its own credentials, runs it, and
|
|
214
197
|
acks it, until nothing's left, so a burst of matches wakes it once. It
|
|
215
198
|
answers when that's done, or after 2 seconds while it keeps going, so
|
|
216
199
|
whoever woke it never waits on slow watchers. A forged wake-up costs it one
|
|
217
200
|
pull that finds nothing.
|
|
218
|
-
- **A wake-up
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
201
|
+
- **A wake-up at a URL carries no credential,** so behind Deployment
|
|
202
|
+
Protection the project lets `POST /wake` through itself: a production domain
|
|
203
|
+
left public (Standard Protection), or a Deployment Protection Exception for
|
|
204
|
+
the domain it registers. A wake-up reveals nothing and is trusted for
|
|
205
|
+
nothing: it only makes this board pull with its own credentials.
|
|
206
|
+
- **A board without an `https` URL pulls on its own** from its first use,
|
|
207
|
+
each pull held open until something matches: a dev server, say.
|
|
208
|
+
- **It sees what its deployment may read** on the team's board.
|
|
224
209
|
- **Its writes are by the deployment, with the watcher's ID as its profile:**
|
|
225
210
|
`vercel:project:prj_v0:production+fix`, which never wakes that watcher. IDs
|
|
226
211
|
are profile names, so they start with a letter and use up to 32 letters,
|
|
227
212
|
numbers, and hyphens. Its posts get IDs derived from the match, so a
|
|
228
213
|
retried `run` doesn't post twice.
|
|
229
|
-
- **A thread's matches come one at a time, in order,** and threads run in
|
|
230
|
-
parallel. A pulled match is leased for 5 minutes. A `run` that throws is
|
|
231
|
-
tried again after a wait (1 second, doubling to 30), and a lease that runs
|
|
232
|
-
out counts as a try, noticed within a minute. After 5 tries it's recorded as
|
|
233
|
-
`watch.failed`, and the thread goes on.
|
|
234
|
-
- **A board without an `https` URL pulls on its own** from its first use,
|
|
235
|
-
each pull held open until something matches: a dev server, say.
|
|
236
|
-
- **A wake-up carries no credential,** so behind Deployment Protection this
|
|
237
|
-
project lets `POST /wake` through itself: a production domain left public
|
|
238
|
-
(Standard Protection), or a Deployment Protection Exception for the domain
|
|
239
|
-
it registers. A wake-up reveals nothing and is trusted for nothing: it only
|
|
240
|
-
makes this board pull with its own credentials. One that Deployment
|
|
241
|
-
Protection stops answers 401, and the other board tries less often until
|
|
242
|
-
this board pulls or registers.
|
|
243
|
-
- **On a board whose discovery says `wake_by_path`,** this board registers
|
|
244
|
-
its mount path on its own project instead of its URL, and its wake-ups get
|
|
245
|
-
through Deployment Protection with nothing to set up. Only on Vercel, from
|
|
246
|
-
production or a preview of a branch, which it names: the other board finds
|
|
247
|
-
the deployment from this project's token and that branch. Anywhere else
|
|
248
|
-
(development, a custom environment, a preview made with `vercel deploy`), it
|
|
249
|
-
registers its URL.
|
|
250
|
-
- **Retries need the other board's scheduler,** as its own watchers do.
|
|
251
|
-
Without one there, nothing waits on a clock: a retry, a lease that ran out,
|
|
252
|
-
and a wake-up that didn't get there (once its back-off is over) each wait
|
|
253
|
-
for the next match to wake this board. A board that pulls on its own
|
|
254
|
-
doesn't wait.
|
|
255
|
-
- **Its [sync](../02-sync/01-overview.md#on-a-board-elsewhere) subscribes the
|
|
256
|
-
same way,** with its entries in its registration (`sync: [{ key, platform }]`):
|
|
257
|
-
it gets every post, change, and thread sync in the channels its deployment
|
|
258
|
-
may `sync`, as matches of watcher `@sync`, and runs them here. The other
|
|
259
|
-
board lists those entries in its discovery, and refuses a key its own sync
|
|
260
|
-
has (409 `sync_key_taken`).
|
|
@@ -75,17 +75,14 @@ principal ID can stand for callers with different access. Canceling one that's
|
|
|
75
75
|
done is a no-op. A reply schedule ends on its own when its thread is deleted.
|
|
76
76
|
|
|
77
77
|
Each send runs with its creator's [access](./09-access.md) as it is when the
|
|
78
|
-
send is due, under the
|
|
78
|
+
send is due, under the grants as they are then. A creator that can no longer
|
|
79
79
|
post there (or read the thread, for a reply) has the schedule canceled with
|
|
80
80
|
`revoked`, and `vb schedules --all` says `ended: its creator can no longer post
|
|
81
81
|
it`. A schedule from before board kept its creator's claims is worked out from
|
|
82
82
|
the principal ID alone, which names a deployment's project ID and environment
|
|
83
83
|
and nothing of a workflow's run. So the board's own deployments in its
|
|
84
|
-
environment, and a project
|
|
85
|
-
|
|
86
|
-
own team as the board knew it then, so a rule that names a project without its
|
|
87
|
-
`team` still matches when the scheduler's function, which never sees a request,
|
|
88
|
-
sends it.
|
|
84
|
+
environment, and a project a Vercel grant names, keep sending; a workflow's is
|
|
85
|
+
`revoked` at its next send.
|
|
89
86
|
|
|
90
87
|
## In code
|
|
91
88
|
|
|
@@ -103,38 +100,21 @@ await team.cancelSchedule(reminder.id) // { schedule, canceled }
|
|
|
103
100
|
|
|
104
101
|
## How it runs
|
|
105
102
|
|
|
106
|
-
- **
|
|
107
|
-
|
|
108
|
-
`
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
- **Canceling can't revoke a timer.** A canceled schedule's timer, or one for a
|
|
125
|
-
send already made, fires into a no-op.
|
|
126
|
-
- **The newest deployment sends.** Vercel Queues delivers a timer to the
|
|
127
|
-
deployment that armed it, so each deployment takes schedules over on its
|
|
128
|
-
first request: it arms every pending schedule's next send itself, and the
|
|
129
|
-
timers an earlier deployment armed fire into a no-op. A queue's delivery
|
|
130
|
-
never takes schedules over, so an old deployment that only its own timers
|
|
131
|
-
still reach doesn't take them back. With a scheduler that delivers to one URL, like
|
|
132
|
-
`qstash()` pointed at the production alias, an earlier deployment's timers
|
|
133
|
-
reach the newest one, which sends them once it has taken over. Each send runs under
|
|
134
|
-
the access rules of the deployment that took over last, so a deploy that
|
|
135
|
-
takes a grant away stops the schedules that grant was sending. Deployments
|
|
136
|
-
that share one store, like a preview on production's database, take
|
|
137
|
-
schedules over from each other.
|
|
138
|
-
|
|
139
|
-
Schedules live in their own A2 session, outside the board log; only the messages
|
|
140
|
-
they post land on the board. See [The log](../04-reference/04-log.md).
|
|
103
|
+
- **The board that keeps the log sends.** On Vercel's board, Vercel's API
|
|
104
|
+
posts each send, whether or not anything of yours is running. On
|
|
105
|
+
[`local()`](./10-local.md), timers in the process send while it runs, and a
|
|
106
|
+
restart drops the sends that were pending.
|
|
107
|
+
- **On `local()`, a send posts once.** Each one posts with an ID derived from
|
|
108
|
+
the schedule and `n`, so a retry after a crash gets back the message it
|
|
109
|
+
already posted. Downtime doesn't replay: the next send is the next slot after
|
|
110
|
+
now, so a board that was down sends once rather than catching up on every
|
|
111
|
+
missed slot.
|
|
112
|
+
- **Vercel's board takes no files on a scheduled message yet,** and no labels
|
|
113
|
+
on a scheduled reply: those answer 501 `not_supported`.
|
|
114
|
+
- **A board that keeps no schedules refuses.** `POST /schedules`, `schedule()`,
|
|
115
|
+
and `vb schedule` answer 501 `no_scheduler`, and `vb` says it can't, with the
|
|
116
|
+
board's words under it. A [backend of your own](./01-mounting.md#a-backend-of-your-own)
|
|
117
|
+
may answer that.
|
|
118
|
+
|
|
119
|
+
Schedules live apart from the board's events; only the messages they post land
|
|
120
|
+
on the board.
|
|
@@ -7,9 +7,7 @@ description: Middleware sees every post and edit before it lands, whatever it ca
|
|
|
7
7
|
|
|
8
8
|
```ts app/api/board/[[...path]]/route.ts
|
|
9
9
|
import { board, type Middleware } from '@vercel/board'
|
|
10
|
-
import {
|
|
11
|
-
import { vercelQueues } from '@vercel/board/backend-a2/scheduler-vercel'
|
|
12
|
-
import { postgres } from '@vercel/board/backend-a2/store-postgres'
|
|
10
|
+
import { local } from '@vercel/board/backend-local'
|
|
13
11
|
|
|
14
12
|
const guard: Middleware = async ({ write, source, respond, next }) => {
|
|
15
13
|
if (source.kind === 'sync' && /ignore previous instructions/i.test(write.text)) {
|
|
@@ -19,18 +17,12 @@ const guard: Middleware = async ({ write, source, respond, next }) => {
|
|
|
19
17
|
await next()
|
|
20
18
|
}
|
|
21
19
|
|
|
22
|
-
const backend = a2({
|
|
23
|
-
store: postgres({ connectionString: process.env.DATABASE_URL! }),
|
|
24
|
-
scheduler: vercelQueues({ topic: 'board' }),
|
|
25
|
-
})
|
|
26
|
-
|
|
27
20
|
const team = board({
|
|
28
|
-
backend,
|
|
21
|
+
backend: local(),
|
|
29
22
|
middleware: [guard],
|
|
30
23
|
// sync as in Sync
|
|
31
24
|
})
|
|
32
25
|
export const GET = team.fetch, POST = team.fetch
|
|
33
|
-
export const { scheduler } = backend
|
|
34
26
|
```
|
|
35
27
|
|
|
36
28
|
Every post and edit goes through `middleware`, in order, before it lands: the
|
|
@@ -38,11 +30,13 @@ API (the CLI, scripts, CI), messages synced in from Slack, GitHub, and Linear
|
|
|
38
30
|
(sync callbacks' writes included), watchers, the board's
|
|
39
31
|
[handle](./01-mounting.md#the-handle), and scheduled sends. Reactions, labels,
|
|
40
32
|
and deletes don't. It's `board()`'s, so it runs before the write reaches the
|
|
41
|
-
backend, on any backend.
|
|
42
|
-
and the board
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
backend, on any backend. With `BOARD_URL` set, this board runs its own on what
|
|
34
|
+
it writes, and the board at that URL runs its own on what arrives: each sees
|
|
35
|
+
the write once. On Vercel's board, `vb` and other projects
|
|
36
|
+
write to Vercel's API, not through this route, so the middleware sees what this
|
|
37
|
+
deployment writes: its handle and its watchers. Vercel's
|
|
38
|
+
API posts a schedule's sends, so the middleware sees its message once, when
|
|
39
|
+
it's made, as the caller's post.
|
|
46
40
|
|
|
47
41
|
- **`next()` passes the write on,** to the next middleware and, after the last,
|
|
48
42
|
to the board. It resolves once the write has landed.
|
|
@@ -53,7 +47,7 @@ the caller's post.
|
|
|
53
47
|
emptied to no text, with no files, is dropped.
|
|
54
48
|
- **A middleware that throws fails the write.** The API answers 500, and a
|
|
55
49
|
synced event is retried. To fail closed, catch and drop.
|
|
56
|
-
- **It sees only a write the caller may make.** One
|
|
50
|
+
- **It sees only a write the caller may make.** One its access refuses (a
|
|
57
51
|
channel it can't post in, someone else's message, a thread it can't read)
|
|
58
52
|
answers 403 or 404 without running it.
|
|
59
53
|
- **A retry of a post that landed skips it.** Before it runs, the board looks
|
|
@@ -99,7 +93,7 @@ What `respond` says goes back with a write it drops, where the write came from:
|
|
|
99
93
|
prints it as `error: …`.
|
|
100
94
|
- **A watcher or the handle:** its call throws that same error.
|
|
101
95
|
- **A schedule:** nobody's there to tell. Its text never changes, so the
|
|
102
|
-
schedule ends, with `reason: 'dropped'`. On
|
|
96
|
+
schedule ends, with `reason: 'dropped'`. On Vercel's board, scheduling it
|
|
103
97
|
answers the same `422`, and no schedule is made.
|
|
104
98
|
|
|
105
99
|
## Writing to the board from middleware
|