Skip to content

feat(slack): receive signed reaction events - #51

Draft
brennenho wants to merge 1 commit into
brennen/demo-ctc-45from
brennen/demo-ctc-44
Draft

brennenho wants to merge 1 commit into
brennen/demo-ctc-45from
brennen/demo-ctc-44

Conversation

@brennenho

Copy link
Copy Markdown
Contributor

Summary

Adds POST /api/slack/events for CTC Internal's reaction counter. The endpoint authenticates Slack, answers its URL verification challenge, and sends matching message reactions to the D1 writer on the CTC-45 parent branch. CTC-44

Changes

  • Verify Slack's HMAC against the bounded raw request body and check timestamp freshness before parsing the event.
  • Filter by event type, channel ID, and emoji. Acknowledge a matching delivery once the writer succeeds and return a retryable status on storage failure.
  • Document the bot scope, event subscriptions, channel installation, and Worker configuration. The webhook needs SLACK_SIGNING_SECRET in addition to CTC-45's channel and emoji settings.

Testing

  • pnpm check passed formatting, lint, type checking, and all 110 tests.
  • Applied the migrations to local D1 and sent signed HTTP fixtures to the running Next.js app. The challenge was echoed, an invalid signature returned 401, and the wrong channel and emoji left the count at zero.
  • Read the local D1 count after each matching request. Add and duplicate add produced one row. Remove, a late retry of the add, and duplicate remove all left zero rows.
  • Live Slack installation and delivery on a deployed Worker remain unverified.

@linear-code

linear-code Bot commented Nov 19, 2026

Copy link
Copy Markdown

CTC-44

@github-actions

Copy link
Copy Markdown

Preview deployment

Open preview ↗

Last deployed 2026-11-19T04:21:55Z

Commit Workflow
76d9999 Run #78 · attempt 1

Fallback preview

rachelrrhe added a commit that referenced this pull request Nov 19, 2026

This branch was successfully deployed

1 active deployment
pr-51 — 76d99990 Deployed Nov 19, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant