Home

boring / v2

publicBoring-Software-Inc/v2
Overview Code History Branches Pull requestsIssuesInsights Campfire Docs
main
HomeOverview Code PRsIssues

fix: deliver discord nodes on comment/schedule triggers

closed
#182 opened by detail-app[bot]detail/bug-fix/fix-deliver-discord-nodes-on-comment-schedule-trig-92ca19→main
Conversation4
detail-app[bot]
Commits
0
Files changed…
opened this pull request
Author
· 2 weeks ago

Detail bug report: View on Detail

Closes #169

What was wrong

On the thread path (emitThreadActions in apps/worker/src/jobs/pr-surface.ts, used for comment.created and schedule.matched triggers), delivery payloads were attached only to webhook rows — discord rows were left without a payload. The execution loop also skipped only webhook rows, so discord rows fell through to toForgeAction, whose default: branch re-typed them as a block forge action. This meant:

  • A Discord node on a comment- or schedule-triggered workflow never delivered its message.
  • With forge credentials present, the discord row was mis-executed as a REQUEST_CHANGES review ("Blocked. See the comment.") on the PR, and marked executed — so it would never be delivered.
  • Without credentials (or on an issue thread where the pulls API 404s), the row stayed recorded with no payload, and the deliver-webhook cron permanently destroyed it as "malformed".

The PR path (emitPrSurface) already handled both webhook and discord correctly; the thread path was never updated when Discord nodes were restored in a prior revert.

What I changed

Mirrored the PR path inside emitThreadActions:

  • The payload-attach loop now treats webhook and discord alike — both get a WebhookPayload attached.
  • The execution loop now skips both delivery kinds, so neither reaches the forge adapter.
  • As defense in depth, toForgeAction now throws on webhook/discord kinds instead of silently falling through to the default: block branch — so a future delivery kind can't quietly become a bogus review.

What I decided

I added a throw in toForgeAction for delivery kinds rather than just fixing the two loops. The loops are the real fix, but the default: branch accepting unknown kinds was the oversight that let this bug stay silent — making it loud prevents the next delivery kind from biting the same way. The throw is unreachable from the two existing call sites (both skip delivery kinds before calling toForgeAction), so it's purely a guard.

Testing

  • Unit tests for toForgeAction confirming webhook and discord rows throw (including with a live review id, which previously fell through to update-review).
  • Integration test on a real postgres container covering both thread paths (comment.created and schedule.matched): discord rows get a payload attached, are not mis-executed as a block, and are delivered by the deliver-webhook cron — with and without forge credentials. A guard test confirms non-delivery actions (e.g. lock) still execute, so the fix doesn't over-skip.
  • Confirmed the integration tests fail without the fix (5 of 6 go red — discord rows have no payload, or are mis-executed as a block) and pass with it.
  • Existing integration tests (deliver-webhook, schedule-tick, sweep-actions, review-lifecycle), typecheck, and biome all pass.

Automatic Fixes PRs can be configured here.

unkey-deploy[bot]commented· 2 weeks ago

The latest updates on your projects. Learn more about Unkey Deploy

NameStatusPreviewInspectUpdated (UTC)
tripwire / web (preview)ReadyVisit PreviewInspectNov 7, 2026 6:54am

Changes requested

tripwire-sh[bot] · 2 weeks ago

Blocked. See the comment.

tripwire-sh[bot]commented· 2 weeks ago

@detail-app[bot], Tripwire blocked this change request.

Rate limit: You opened 56 change requests in a short time. Wait before you open another.

View on Tripwire

How do I fix this?

A new commit will not fix this.

If you think it should merge anyway, say so in a comment. A maintainer will decide.

capy-ai[bot]commented· 2 weeks ago

Capy couldn't review this pull request because grim's workspace is out of credits, add credits or enable auto-reload to resume automatic reviews.

Open in Capy

Sign in to comment.

Merge readiness

Checking mergeability after the indexing worker computes the current branch state.

Autopilot

Debug

Reviews

Approved0
ReviewersNone yet

Configure an OpenRouter key in repository settings.