#323
Linear: webhook deliveries omit `Linear-Timestamp`, Issue payloads lack `state`, `updatedFrom` holds the whole issue
Problem
Three differences between the Linear emulator's webhook deliveries and Linear's documented payloads make a standard receiver reject or misread them.
- No
Linear-Timestampheader.dispatchLinearWebhook(packages/@emulators/linear/src/webhooks.ts) sendsLinear-Delivery,Linear-EventandLinear-Signature, but notLinear-Timestamp. Linear documents that header ("The Unix timestamp, in milliseconds, when the webhook was sent"), and the official SDK still reads it (LINEAR_WEBHOOK_TS_HEADER = "linear-timestamp"inpackages/sdk/src/webhooks/client.ts). A receiver whose replay guard reads the header refuses every emulated delivery. The body'swebhookTimestampis already present. - Issue payloads have
stateIdbut nostate.issueWebhookPayload(routes/graphql.ts) returnsstateIdonly. Linear's schema declaresstate: WorkflowStateChildWebhookPayload!(id,name,type,color) onIssueWebhookPayload(packages/sdk/src/schema.graphqlin linear/linear), and receivers usestate.type == "completed"to detect a closed issue. updatedFromcontains the whole previous issue. OnissueUpdatethe emulator passesupdatedFrom: before, wherebefore = issueWebhookPayload(context, issue). Linear documentsupdatedFromas "an object containing the previous values of all updated properties". Every update therefore looks like a change to every field (for example a status change on a title edit).
Reproduced on published emulate 0.12.2. The code is unchanged on main at 4c0422e.
Reproduction
- Seed a team with workflow states, an issue, and a webhook with a secret pointing at a local receiver.
issueUpdate(id, input: { stateId: <completed state> }).- Inspect the delivery.
Actual: no Linear-Timestamp header, data.state absent, updatedFrom lists every issue field.
Expected (per https://linear.app/developers/webhooks): a Linear-Timestamp header equal to webhookTimestamp, data.state with id, name, type, color, and updatedFrom limited to the fields the mutation changed (here stateId and updatedAt).
Activity
0No activity yet.