docs(connect): webhook path uses the endpoint key and held hooks are per link #17413
Closedmacodev00(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/17413/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
coderabbitai[bot](GitHub profile, opens in a new tab) requested changes
docs/internals/t3-connect.md lines 23 to 25OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -11,12 +8,18 @@8+`/v1/hooks/:endpointKey/:hookId/:token` to the environment's tunnel so9+senders get a stable URL. `:endpointKey` is the 16-hex key of the link's10+managed tunnel, not the environment id. It keeps bodies and tokens out of its11+traces and leaves token and signature verification to the environment1112 ([forwarder](../../infra/relay/src/hooks/HookForwarder.ts)).12131314 By default the forwarder stores nothing. An environment can opt in to having1415 the relay hold requests while it is offline1516 (`hold_webhooks_while_offline` on its link). Only then does the relay store the1617 raw request, including the hook token in the path, in a Durable Object for17-that environment, with SQLite storage. The object pushes held requests back18+that link's managed endpoint (named by its endpoint key), with SQLite storage.19+Each link has its own endpoint key, so two accounts that link the same20+environment get separate inboxes. The object pushes held requests back1821 through the tunnel from its alarm, oldest first, and backs off while the1922 environment stays away. When the tunnel reconnects, the environment asks the2023 relay to deliver right away. Requests are deleted once the environment21-answers, after 24 hours, or when no user has the environment linked. The relay22-still never checks the token; delivery goes through the same environment route.24+answers, after 24 hours, when that link is unlinked, or when the environment25+turns `hold_webhooks_while_offline` off. The relay still never checks thedocs/internals/t3-connect.md lines 31 to 34OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -18,13 +19,16 @@19+Each link has its own endpoint key, so two accounts that link the same20+environment get separate inboxes. The object pushes held requests back1821 through the tunnel from its alarm, oldest first, and backs off while the1922 environment stays away. When the tunnel reconnects, the environment asks the2023 relay to deliver right away. Requests are deleted once the environment21-answers, after 24 hours, or when no user has the environment linked. The relay22-still never checks the token; delivery goes through the same environment route.24+answers, after 24 hours, when that link is unlinked, or when the environment25+turns `hold_webhooks_while_offline` off. The relay still never checks the26+token; delivery goes through the same environment route.2327 Every forward carries `x-t3-relay-delivery-id`, so a request that reached the2428 environment before a timeout and is delivered again later runs once2529 ([inbox object](../../infra/relay/src/hooks/HookInboxObject.ts)).26302731 A Durable Object, not Postgres or Queues, because held requests are write-once,28-read-once bodies of up to 1 MiB that need per-environment order, caps, and29-retry timing. Queues cap messages at 128 KB and cannot hold one environment's30-requests back while it is away.32+read-once bodies of up to 1 MiB that need per-endpoint (per-link) order, caps,33+and retry timing. Queues cap messages at 128 KB and cannot hold one endpoint's34+requests back while its environment is away.github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:S
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
maria-rcks closed this
maria-rcks reopened this
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes