Skip to content

Commit bef80d3

Browse files
fix(spec,plugin-webhooks)!: retire the GET webhook method and park stored GET subscriptions with a visible reason (#34239)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbCpddLFmKzR39wJWZpkRMCi)_ Fixes #34098 Clause-②: no (narrowing) Metadata-protocol: narrowed Skills-docs: none — `git grep` of `skills/` finds no webhook `method` value taught anywhere, so no page names `GET` as a webhook method. > **BREAKING** — a webhook can no longer be authored with `method: 'GET'`, on either surface: `WebhookSchema.method` (`@objectstack/spec/automation`) and the `sys_webhook` `method` select (`@objectstack/plugin-webhooks`). A row already stored with `get` is parked with a visible reason, never converted. Migration: set the method to `POST`, `PUT`, `PATCH` or `DELETE`. ADR-0087 D3 entry `webhook-method-get-retired`; no D2 conversion exists. Maintainer ruling (6902187601), quoted as tapped: 「A 从契约中移除 GET」 — spec 枚举和 sys_webhook 下拉都去掉 GET,属破坏性变更;已存的 GET 行停用并写明原因,不自动改成 POST。 ## 维护者速读 - 改了什么:Webhook 的请求方法去掉 GET(spec 枚举和 Setup 下拉两处);已经存成 GET 的 Webhook 不再投递,每个事件记一条带原因的 dead 投递记录。 - 为什么改:每次投递都把事件放在请求正文里,GET 请求没有正文,所以 GET Webhook 从来没有成功送达过一次。 - 风险与回滚:破坏性变更,只影响写了 GET 的 Webhook(仓库内没有);已存的 GET 行不会被改成别的方法。回滚即还原本 PR。 - 先看:`packages/plugins/plugin-webhooks/src/auto-enqueuer.ts`(`parseRow` 里的停用分支与刷新循环跳过凭据),`packages/spec/src/automation/webhook.zod.ts`(枚举与提示文案),`.changeset/34098-webhook-method-get-retired.md`。 - 两分钟验证:`pnpm --filter @objectstack/plugin-webhooks exec vitest run --maxWorkers=2 src/webhook-get-retired-34098.test.ts`,预期 7 个测试全部通过。 - 需要你做的:无,席位落地(需一次 spec 契约面的 CONTRACT_REVIEW_TIER 复核)。 ## What changes - **Spec** (`packages/spec/src/automation/webhook.zod.ts`): `method` is `enumWithRetiredValues(['POST','PUT','PATCH','DELETE'], { GET: … })`, default `POST` unchanged. `method: 'GET'` fails parse with a prescription naming the four methods; any other unknown value keeps zod's own message. `HEAD` was never in the enum and is not mentioned. - **D3 entry** (`packages/spec/src/migrations/entries/semantic/18.webhook-method-get-retired.ts`): the upgrade-guide entry. No D2 conversion: converting GET would start sending another method to an endpoint configured for GET. - **Select** (`packages/plugins/plugin-webhooks/src/sys-webhook.object.ts`): four options. The record validator now refuses an insert or update with `method: 'get'` (`VALIDATION_FAILED`, a field error `invalid_option` on `method`). The `options.get` leaf and its source hash leave all eleven locale bundles (regenerated with `node scripts/check-i18n-bundles.mjs --write --filter=webhooks`; the diff is 21 deletions only). - **Park** (`packages/plugins/plugin-webhooks/src/auto-enqueuer.ts`): `parseRow` sets `parkedReason` when the stored method is retired. The refresh loop then skips credential resolution for that row (a parked subscription carries no secret and no header map), and `projectDeclared` does the same for a declared webhook handed in by a reader that skipped the schema. Each matched event goes through the existing #8069 path to `recordUndeliverable()`: one `dead` row, 0 attempts, no signature, reason `[VALIDATION_ERROR/400] webhook 'NAME' is stored with HTTP method GET … Fix: edit the webhook and set its method to POST, PUT, PATCH or DELETE …`. Said once at `error`. Parked events never call `enqueue`, so the outbox's bodyless-GET refusal from #34067 is not reached. The stored method is never rewritten. - **Declared webhooks**: `DeclaredWebhookSource.parseItem` parses through `WebhookSchema`, so a declared GET is now refused there with the existing "declared webhook failed validation — not dispatched" warning and never reaches the dispatcher. `declared-webhooks.ts` is unchanged. - **Docs**: `content/docs/automation/webhooks.mdx` method row without GET, plus a "Stored GET webhooks are parked" note; `content/docs/references/automation/webhook.mdx` regenerated by `gen:docs`. Sequencing: built after PR #34067 (#33895) merged (`0d1443d0` on main, merged into this branch). Reviewer note N5 on #34067: until this PR lands, a GET webhook on main leaves only a lost-event log line and no delivery row, so this PR should ship in the same release as #34067. ## Tests New file `packages/plugins/plugin-webhooks/src/webhook-get-retired-34098.test.ts`, on a real `SqlDriver` (SQLite) under a real `ObjectQL`, with `SqlHttpOutbox`, `MessagingService` and `HttpDispatcher`: - save door: insert with `get` refused `VALIDATION_FAILED` (the engine's `ValidationError`; REST maps it to 400) with `invalid_option` on `method`, nothing stored; update to `get` refused, stored method still `post`; the four methods save; the select offers exactly four. - stored GET row (H1, H3): one `dead` row per event with 0 attempts, no signature, `method: GET` and the reason; a dispatcher tick sends nothing; `redeliverHttp` refused `DELIVERY_NEVER_SENT`; the park is reported once at `error` with `code`/`status`/`method` in meta; the stored method reads `get` through the driver and the engine. - CONTROL (H2): a POST row delivers one POST carrying the envelope. - declared GET: refused at parse by `DeclaredWebhookSource`; one handed in past the schema is parked with no credentials on the row. Spec side, in the existing `packages/spec/src/automation/webhook.test.ts`: the four methods parse; `GET` is refused with `invalid_value` at `['method']` and the prescription's first sentence; `TRACE` keeps zod's message. ## Acceptance notes - PM hypotheses: H1 holds (one dead row per event, reason present, no signature, fetch not called). H2 holds (the POST control delivers; healthy rows take the unchanged path). H3 holds (the method reads `get` after the park). - The park reason carries the standard-catalog pair `[VALIDATION_ERROR/400]`, the pair `webhook-legacy-cleartext.ts` carries on its own delivery door; the save door's `VALIDATION_FAILED` is the engine record validator's own answer. A first cut stamped `VALIDATION_FAILED` in plugin-webhooks and `check:error-code-provenance` refused it (a registered code with no provenance row under the plugin's owner key); the standard-catalog member needs no ledger row, so no new error code and no ledger edit. - The spec's generated ratchets moved nothing: `check:generated` reports all 14 up to date and the diff touches nothing under `api-surface/`, `authorable-surface/` or `json-schema.manifest/`, as an enum-value narrowing is expected to (the def, its exports and its key are unchanged); only the generated reference page shows the four values. ## Verification Final head `b61479ce` (main merged at `8ab601e3`, #34067 included). Each reading names its head. At open, `git merge-tree --write-tree` against origin/main `7be32d39` is clean and none of the 27 newer main commits touches a file in this diff; main was not merged again so the battery stays on the final head. <details><summary>Ablations at `4ff9df50` (each restored through a trap, git diff HEAD empty, HEAD blob hashes matched)</summary> - Park removed (`retiredMethodParkReason` returns undefined): 2 failed / 5 passed — `expected 'pending' to be 'dead'` for the stored GET row and for the declared GET past the schema. - GET put back in the select: 3 failed / 4 passed — `expected undefined to be defined` (insert admitted), `expected undefined to match object { code: 'VALIDATION_FAILED' }` (update admitted), the options list. - Spec enum back to `z.enum(['GET', …])`: 1 failed / 24 passed — `expected true to be false` (GET parsed). </details> <details><summary>Suites and gates</summary> - `b61479ce`: `pnpm --filter @objectstack/plugin-webhooks test` 26 files, 314 tests passed; `typecheck` exit 0. - `8ab601e3`: `pnpm --filter @objectstack/spec test` 843 files, 26983 passed, 1 todo; `typecheck` exit 0. Spec `test:repo` is left to CI's Test Core. - `8ab601e3`: `pnpm --filter @objectstack/spec check:generated` all 14 artifacts up to date. - `8ab601e3`, direct dependents of plugin-webhooks: `@objectstack/verify` test 52 files, 439 passed; http-conformance's two webhook files 13 passed; cli `--project unit` on its webhook-touching files 4 files, 176 passed (narrowed to the files that name webhooks; the full cli suites are CI's). Spec's dependents are CI's. - Dogfood battery (`pnpm --filter @objectstack/dogfood test` under the verify lock, closure built), final head `b61479ce`: VERDICT command-exit 0, Test Files 469 passed / 3 skipped (472), Tests 3974 passed / 42 skipped (4016), no failure. The same counts at `69f9d19c`. - Derived gates (`dispatch-gates.mjs --commands`, 118 families) at `69f9d19c` / `cf97ed4d`, the first 48 re-run at `b61479ce`: 116 exit 0. `check:error-code-provenance` and `check:query-options-erasure` were red on the first cut (a stamped `VALIDATION_FAILED`, three `as any` query-option casts in the new test) and are exit 0 after the fix. NOT MEASURED (exit 3, prerequisite not met, CI runs them): `check:skill-examples` (needs `@objectstack/client-react` built), `check:dual-build-cjs-loads` (needs every package built). `--ran` reconciliation: 118 derived, 116 run, 2 NOT-MEASURED, 0 UNRUN. `pnpm lint` exit 0. `check-changeset-no-major`, `check-adr-0087-registration` (registered `webhook-method-get-retired`, new here), `check-closing-keyword-parity`, `check-partof-closing-keyword`, `check:nul-bytes`, `check:error-code-casing`: exit 0 on this body and changeset. </details> Session: https://claude.ai/code/session_01QsR2jUZKdq3PK2Sab53cT3 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent c47e4ea commit bef80d3

30 files changed

Lines changed: 584 additions & 34 deletions
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/plugin-webhooks': minor
4+
---
5+
6+
fix(spec,plugin-webhooks)!: a webhook can no longer be saved with method `GET`, and a stored GET webhook is parked with a visible reason instead of failing silently
7+
8+
Clause-②: no (narrowing)
9+
Metadata-protocol: narrowed
10+
Skills-docs: none — `git grep` of `skills/` finds no webhook `method` value taught anywhere, so no page names `GET` as a webhook method.
11+
12+
<!-- adr-0087: registered webhook-method-get-retired -->
13+
14+
**BREAKING** for a webhook authored with `method: 'GET'`. Every webhook delivery sends the event envelope as its request body, and a GET request carries none, so no GET webhook ever delivered an event: the outbox sent the body, the HTTP client refused a GET with a body, and the delivery retried until dead. `GET` is removed from both authoring surfaces.
15+
16+
What moves (each line FROM → TO):
17+
18+
- `WebhookSchema.method` (`@objectstack/spec/automation`, a declared webhook in `defineStack({ webhooks })`): FROM `GET` / `POST` / `PUT` / `PATCH` / `DELETE` TO `POST` / `PUT` / `PATCH` / `DELETE` (default `POST`, unchanged). `method: 'GET'` fails parse with a prescription naming the four methods; any other unknown method keeps zod's own message. A declared GET webhook already in a registry is skipped with the existing "declared webhook failed validation — not dispatched" warning.
19+
- the `sys_webhook` `method` select (`@objectstack/plugin-webhooks`, Setup and the data API): FROM five options TO four; an insert or an update with `method: 'get'` FROM stored TO refused 400 `VALIDATION_FAILED`. The `options.get` translation leaves every locale bundle.
20+
- a `sys_webhook` row already stored with `get`: FROM retried until dead on every event (and, from the outbox's bodyless-GET refusal on, a lost-event log line and no delivery row) TO parked — each event it matches is written to `sys_http_delivery` as a `dead` row with 0 attempts, no signature and a reason that names the method and the fix, said once at `error`; nothing is sent and the row cannot be redelivered.
21+
22+
The fix: set the webhook's `method` to the one the endpoint accepts a body on — `POST` (the default), `PUT`, `PATCH` or `DELETE`. The parked row re-arms at the next periodic cache refresh. A receiver that only answers GET cannot take a webhook.
23+
24+
No conversion is made, at load, at save or by a migration (ADR-0087 D3, entry `webhook-method-get-retired`): there is no lossless one, because converting GET to another method would start sending a different request to an endpoint its administrator configured for GET. A stored row's method is left exactly as stored.
25+
26+
Unchanged: a `POST` / `PUT` / `PATCH` / `DELETE` webhook delivers byte-identically; `HEAD` was never a webhook method on either surface.

‎content/docs/automation/webhooks.mdx‎

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ returned in full by `GET /api/v1/data/sys_webhook`.
172172
| `object_name` | text | Short object name whose record events fire this webhook. |
173173
| `triggers` | select | Multi-select of `create` / `update` / `delete` plus the opt-in bulk pair `bulk_update` / `bulk_delete` ([see below](#bulk-writes-bulk_update-and-bulk_delete)), stored as an array (the enqueuer also accepts a legacy comma-separated string). |
174174
| `url` | text | External endpoint that receives the POST. |
175-
| `method` | select | HTTP method — one of `GET` / `POST` / `PUT` / `PATCH` / `DELETE`. Default `POST`. |
175+
| `method` | select | HTTP method — one of `POST` / `PUT` / `PATCH` / `DELETE`. Default `POST`. No `GET`: every delivery carries the event as its body ([see below](#stored-get-webhooks-are-parked)). |
176176
| `description` | textarea | Free-text description. |
177177
| `active` | boolean | Inactive webhooks are skipped by the dispatcher. Default `true`. |
178178
| `definition_json` | textarea | Serialised `Webhook` JSON (`WebhookSchema` from `@objectstack/spec/automation`) — the per-attempt `timeoutMs` and the rest of the authored envelope. **Not** the signing secret and **not** the custom headers: each has its own encrypted column below. |
@@ -237,6 +237,24 @@ row, or move the values into their encrypted columns yourself. Never type a toke
237237
ages it out.
238238
</Callout>
239239

240+
### Stored GET webhooks are parked
241+
242+
`GET` was removed from the `method` select and from `WebhookSchema.method`:
243+
every delivery sends the event envelope as its request body and a GET request
244+
carries none, so no GET webhook ever delivered an event. Saving a webhook with
245+
`method: 'get'` — an insert or an update — is now refused
246+
(`VALIDATION_FAILED` / `400`), and a declared webhook with `method: 'GET'`
247+
fails `WebhookSchema` parse with the fix in the message.
248+
249+
A `sys_webhook` row already stored with `get` keeps loading, but it is
250+
**parked**: nothing is sent, and each record change it matches is written to
251+
`sys_http_delivery` as a `dead` row with 0 attempts whose `error` names the
252+
method and the fix. Such a row cannot be redelivered. The stored method is
253+
never rewritten to another one — sending a POST to an endpoint configured for
254+
GET would be a different request. To bring the webhook back, edit it and set
255+
the method to `POST`, `PUT`, `PATCH` or `DELETE`, whichever the endpoint
256+
accepts a body on; it re-arms at the next periodic cache refresh.
257+
240258
### 3.2 `sys_http_delivery`
241259

242260
The outbox + audit. One row per delivery. Persisted **before** any HTTP

‎content/docs/references/automation/webhook.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const result = WebhookSchema.parse(data);
3333
| **object** | `string` | optional | Object whose record events (create/update/delete, bulk_update/bulk_delete) trigger this webhook |
3434
| **triggers** | `Enum<'create' \| 'update' \| 'delete' \| 'bulk_update' \| 'bulk_delete'>[]` | optional | Events that trigger execution |
3535
| **url** | `string` | ✅ | External webhook endpoint URL |
36-
| **method** | `Enum<'GET' \| 'POST' \| 'PUT' \| 'PATCH' \| 'DELETE'>` | optional (default: `"POST"`) | HTTP method |
36+
| **method** | `Enum<'POST' \| 'PUT' \| 'PATCH' \| 'DELETE'>` | optional (default: `"POST"`) | HTTP method |
3737
| **headers** | `Record<string, string>` | optional | Custom HTTP headers |
3838
| **timeoutMs** | `integer` | optional (default: `30000`) | Request timeout in milliseconds |
3939
| **secret** | `string` | optional | Signing secret for HMAC signature verification |

‎packages/plugins/plugin-webhooks/src/auto-enqueuer.ts‎

Lines changed: 117 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,48 @@ const CUSTOM_HEADERS_CREDENTIAL: DropReason = {
121121
ratherThan: 'delivered without the headers it was authored with',
122122
};
123123

124+
/**
125+
* The HTTP methods a webhook may no longer deliver with, upper-cased.
126+
*
127+
* `GET` left both authoring surfaces (the spec's `WebhookSchema.method` and the
128+
* `sys_webhook` `method` select — ADR-0049 enforce-or-remove): every delivery
129+
* sends the event envelope as its request body and a GET carries none, so no
130+
* GET webhook ever delivered. A row stored with `get` before the option left
131+
* still loads, and is PARKED here rather than dispatched.
132+
*/
133+
const RETIRED_WEBHOOK_METHODS: ReadonlySet<string> = new Set(['GET']);
134+
135+
/**
136+
* The ADR-0112 pair a retired-method park carries: the standard-catalog
137+
* member for "this row content is not acceptable", judged at delivery — the
138+
* pair `webhook-legacy-cleartext.ts` carries on its own delivery door. (The
139+
* save door refusing the same value is the engine's record validator, which
140+
* answers with its own code.) A standard-catalog code needs no ledger row.
141+
*/
142+
const RETIRED_METHOD_PARK_CODE = 'VALIDATION_ERROR';
143+
const RETIRED_METHOD_PARK_STATUS = 400;
144+
145+
/**
146+
* [#8069 park path] The reason a subscription whose stored method is retired
147+
* is parked with, or `undefined` for a deliverable method. It names the method
148+
* and the fix, and says the method is left as stored: converting it would
149+
* start sending another method to an endpoint the administrator configured
150+
* for GET, so no conversion is made, here or anywhere.
151+
*/
152+
function retiredMethodParkReason(name: string, method: string): string | undefined {
153+
if (!RETIRED_WEBHOOK_METHODS.has(method)) return undefined;
154+
return (
155+
`[${RETIRED_METHOD_PARK_CODE}/${RETIRED_METHOD_PARK_STATUS}] webhook '${name}' is stored with HTTP method `
156+
+ `${method}, which a webhook can no longer use: every delivery sends the event as its request body and a `
157+
+ `${method} request carries none, so this event was NOT delivered — recorded here rather than sent. `
158+
+ 'This row was never sent and cannot be redelivered. The stored method is left exactly as it is: it is '
159+
+ 'never converted, because sending another method to an endpoint configured for '
160+
+ `${method} would be a different request. Fix: edit the webhook and set its method to POST, PUT, PATCH `
161+
+ 'or DELETE, whichever the endpoint accepts a body on; the subscription re-arms at the next periodic '
162+
+ 'refresh, and later events are delivered normally.'
163+
);
164+
}
165+
124166
/**
125167
* Optional logger interface (subset of console / kernel logger).
126168
*/
@@ -333,6 +375,13 @@ export class AutoEnqueuer {
333375
* is deleted and re-created reports again.
334376
*/
335377
private readonly organizationRefusalReported = new Set<string>();
378+
/**
379+
* Webhook ids whose retired-method park has been said out loud
380+
* ({@link reportRetiredMethod}) — the #8022 say-once shape: once per
381+
* parked subscription, again after its method is fixed and it breaks
382+
* again. Pruned on refresh with the two ledgers above.
383+
*/
384+
private readonly retiredMethodReported = new Set<string>();
336385
/** [ADR-0131 D2/D6] The declared-webhook reader, when the host binds one. */
337386
private readonly declared?: DeclaredWebhookReader;
338387
/** Self-heal subscription on the activation ledger — bound only with {@link declared}. */
@@ -499,6 +548,16 @@ export class AutoEnqueuer {
499548
for (const row of rows) {
500549
const sub = this.parseRow(row);
501550
if (!sub) continue;
551+
// A row parked for its retired method (see `parseRow`) is never
552+
// sent, so neither credential is resolved for it: a parked row
553+
// carries no secret and no header map (the #8069 park rule), and a
554+
// decrypt for a subscription that cannot deliver buys nothing.
555+
if (sub.parkedReason) {
556+
this.reportRetiredMethod(sub);
557+
add(sub);
558+
continue;
559+
}
560+
this.retiredMethodReported.delete(sub.id);
502561
// [#7799, #7986] Neither credential is in the row we just read —
503562
// the signing key and the custom header map both live encrypted in
504563
// `sys_secret`, and this read path returns only a mask. Dereference
@@ -521,7 +580,11 @@ export class AutoEnqueuer {
521580
// deactivated. Otherwise the set grows for the life of the process, and
522581
// a webhook turned off while broken and later turned back on still
523582
// broken would have its first report suppressed as a repeat.
524-
if (this.droppedForSecret.size > 0 || this.organizationRefusalReported.size > 0) {
583+
if (
584+
this.droppedForSecret.size > 0
585+
|| this.organizationRefusalReported.size > 0
586+
|| this.retiredMethodReported.size > 0
587+
) {
525588
const live = new Set(rows.map((r) => String(r?.id)));
526589
for (const sub of declared.subscriptions) live.add(sub.id);
527590
for (const id of this.droppedForSecret) {
@@ -531,6 +594,9 @@ export class AutoEnqueuer {
531594
for (const id of this.organizationRefusalReported) {
532595
if (!live.has(id)) this.organizationRefusalReported.delete(id);
533596
}
597+
for (const id of this.retiredMethodReported) {
598+
if (!live.has(id)) this.retiredMethodReported.delete(id);
599+
}
534600
}
535601

536602
this.logger?.debug?.('[webhook-auto-enqueuer] cache refreshed', {
@@ -629,6 +695,13 @@ export class AutoEnqueuer {
629695
definition_json: JSON.stringify({ timeoutMs: wh.timeoutMs }),
630696
});
631697
if (!sub) return null;
698+
// `WebhookSchema` refuses a retired method, so a declaration parsed by
699+
// `DeclaredWebhookSource` cannot carry one; a reader that hands one in
700+
// anyway is parked by `parseRow` like a row, with no credentials.
701+
if (sub.parkedReason) {
702+
this.reportRetiredMethod(sub);
703+
return sub;
704+
}
632705
const { secret } = splitWebhookSecret(wh as Record<string, unknown>);
633706
const { headers } = splitWebhookHeaders(wh as Record<string, unknown>);
634707
if (secret) sub.secret = secret;
@@ -1047,6 +1120,34 @@ export class AutoEnqueuer {
10471120
}
10481121
}
10491122

1123+
/**
1124+
* Report a subscription parked for its retired method, once
1125+
* ({@link retiredMethodReported}). `error` by the AGENTS.md question: the
1126+
* webhook keeps reading `active: true` in Setup while no matching event
1127+
* is delivered. The consequence and the fix are the park reason itself,
1128+
* which each dead row carries too.
1129+
*/
1130+
private reportRetiredMethod(sub: CachedSubscription): void {
1131+
if (this.retiredMethodReported.has(sub.id)) return;
1132+
this.retiredMethodReported.add(sub.id);
1133+
const message =
1134+
`[webhook-auto-enqueuer] webhook '${sub.name}' is PARKED: ${sub.parkedReason} Until then every matching `
1135+
+ 'record change is recorded in sys_http_delivery as a dead row with 0 attempts carrying this reason, '
1136+
+ 'while the row keeps reading active:true in Setup.';
1137+
const meta = {
1138+
id: sub.id,
1139+
webhook: sub.name,
1140+
method: sub.method,
1141+
code: RETIRED_METHOD_PARK_CODE,
1142+
status: RETIRED_METHOD_PARK_STATUS,
1143+
};
1144+
if (typeof this.logger?.error === 'function') {
1145+
this.logger?.error(message, undefined, meta);
1146+
} else {
1147+
this.logger?.warn?.(message, meta);
1148+
}
1149+
}
1150+
10501151
private parseRow(row: any): CachedSubscription | null {
10511152
if (!row?.id || !row?.url) return null;
10521153
// `triggers` is now authored as a multi-select (stored as an array), but
@@ -1127,17 +1228,26 @@ export class AutoEnqueuer {
11271228
}
11281229
}
11291230

1231+
const name = (row.name as string) ?? row.id;
1232+
// Method is authored via a select whose option values are lowercased
1233+
// (post/put/…); upper-case here so delivery uses a canonical HTTP
1234+
// method regardless of whether the row was authored before or after
1235+
// the select change (legacy rows stored 'POST').
1236+
const method = String(row.method ?? defn.method ?? 'POST').toUpperCase();
1237+
// A method no webhook can deliver with (`GET`, stored before the select
1238+
// and the spec dropped it) PARKS the subscription: it stays cached, and
1239+
// each event it matches is written as a terminal `dead` row carrying
1240+
// this reason instead of being enqueued (#8069's path). The method
1241+
// itself is carried through unchanged — parking never rewrites it.
1242+
const parkedReason = retiredMethodParkReason(name, method);
11301243
return {
11311244
id: row.id as string,
1132-
name: (row.name as string) ?? row.id,
1245+
name,
11331246
objectName: row.object_name ? String(row.object_name) : undefined,
11341247
triggers,
11351248
url: String(row.url),
1136-
// Method is authored via a select whose option values are lowercased
1137-
// (get/post/…); upper-case here so delivery uses a canonical HTTP
1138-
// method regardless of whether the row was authored before or after
1139-
// the select change (legacy rows stored 'POST').
1140-
method: String(row.method ?? defn.method ?? 'POST').toUpperCase(),
1249+
method,
1250+
...(parkedReason ? { parkedReason } : {}),
11411251
// `headers` and `secret` are both filled by attachCredentials()
11421252
// from their encrypted columns, NOT read off the row — see #7799
11431253
// (secret) and #7986 (headers).

‎packages/plugins/plugin-webhooks/src/sys-webhook.object.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,21 @@ export const SysWebhook = ObjectSchema.create({
169169
}),
170170

171171
method: Field.select(
172-
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'],
172+
['POST', 'PUT', 'PATCH', 'DELETE'],
173173
{
174174
label: 'HTTP Method',
175175
required: true,
176176
// Select instead of free text. Option values are lowercased by the
177-
// Field.select helper (get/post/…); the auto-enqueuer upper-cases the
177+
// Field.select helper (post/put/…); the auto-enqueuer upper-cases the
178178
// resolved method before delivery, so existing 'POST' rows and the
179179
// lowercase option values both normalise correctly.
180+
//
181+
// No `GET` (ADR-0049 enforce-or-remove, the spec's `WebhookSchema`
182+
// `method` in step): every delivery carries the event as its body, so
183+
// a GET webhook never delivered, and the select refusing it is what
184+
// refuses it at save. A row stored with `get` before the option left
185+
// is PARKED by the auto-enqueuer with the reason on a dead delivery
186+
// row (`retiredMethodParkReason`); its method is never rewritten.
180187
defaultValue: 'post',
181188
description: 'HTTP method used for the callback request',
182189
group: 'Definition',

‎packages/plugins/plugin-webhooks/src/translations/ar.objects.generated.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const arObjects: NonNullable<TranslationData['objects']> = {
5353
label: "أسلوب HTTP",
5454
help: "أسلوب HTTP المستخدم في طلب الاستدعاء",
5555
options: {
56-
get: "GET",
5756
post: "POST",
5857
put: "PUT",
5958
patch: "PATCH",

‎packages/plugins/plugin-webhooks/src/translations/ar.source-hashes.generated.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
export const arGeneratedSourceHashes: Readonly<Record<string, string>> = {
2121
"objects.sys_webhook.fields.method.options.delete": "f59e059ed51f9bfc",
22-
"objects.sys_webhook.fields.method.options.get": "470848255971c548",
2322
"objects.sys_webhook.fields.method.options.patch": "7de3603749decb30",
2423
"objects.sys_webhook.fields.method.options.post": "004b24eab36d26a4",
2524
"objects.sys_webhook.fields.method.options.put": "04d929ecae7aa435",

‎packages/plugins/plugin-webhooks/src/translations/de.objects.generated.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const deObjects: NonNullable<TranslationData['objects']> = {
5353
label: "HTTP-Methode",
5454
help: "HTTP-Methode für die Callback-Anfrage",
5555
options: {
56-
get: "GET",
5756
post: "POST",
5857
put: "PUT",
5958
patch: "PATCH",

‎packages/plugins/plugin-webhooks/src/translations/de.source-hashes.generated.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
export const deGeneratedSourceHashes: Readonly<Record<string, string>> = {
2121
"objects.sys_webhook.fields.definition_json.label": "efa6ad859212b898",
2222
"objects.sys_webhook.fields.method.options.delete": "f59e059ed51f9bfc",
23-
"objects.sys_webhook.fields.method.options.get": "470848255971c548",
2423
"objects.sys_webhook.fields.method.options.patch": "7de3603749decb30",
2524
"objects.sys_webhook.fields.method.options.post": "004b24eab36d26a4",
2625
"objects.sys_webhook.fields.method.options.put": "04d929ecae7aa435",

‎packages/plugins/plugin-webhooks/src/translations/en.objects.generated.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
5353
label: "HTTP Method",
5454
help: "HTTP method used for the callback request",
5555
options: {
56-
get: "GET",
5756
post: "POST",
5857
put: "PUT",
5958
patch: "PATCH",

0 commit comments

Comments
 (0)