Skip to content

fix: record slack enqueue outcome in webhook history#171

Open
i-am-thor[bot] wants to merge 2 commits into
mainfrom
fix-slack-webhook-enqueue-history
Open

fix: record slack enqueue outcome in webhook history#171
i-am-thor[bot] wants to merge 2 commits into
mainfrom
fix-slack-webhook-enqueue-history

Conversation

@i-am-thor
Copy link
Copy Markdown
Contributor

@i-am-thor i-am-thor Bot commented May 29, 2026

Summary

  • update Slack webhook history only after queue enqueue succeeds
  • mark Slack enqueue failures explicitly instead of implying successful pending-routing
  • add regression coverage for pending-privacy and cached-public enqueue failure cases

Testing

  • pnpm exec vitest run packages/gateway/src/app.test.ts -t "pending privacy history|enqueue_failed history|fresh public-channel cache hit"
  • pnpm --filter @thor/gateway typecheck
  • GitHub Actions: Unit Tests
  • GitHub Actions: Core E2E

AI-generated — verify before acting. View Thor context

Co-authored-by: Son Dao <son.dao@katalon.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Slack webhook history accuracy by recording enqueue outcomes only after the queue operation completes, so failed queue writes are no longer represented like successfully routed events.

Changes:

  • Preserves enqueue_failed history reasons through the webhook history error wrapper.
  • Records successful Slack enqueue metadata after enqueue completion.
  • Adds regression tests for pending-privacy and cached public-channel enqueue failure history.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/gateway/src/app.ts Updates Slack enqueue handling to distinguish succeeded vs failed enqueue history metadata.
packages/gateway/src/app.test.ts Adds coverage for successful pending privacy history and enqueue failure history cases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Move enqueue-failure recording into the shared enqueueSlackEvent
wrapper instead of duplicating try/catch in both defer and accept
paths. Drop the attemptedCorrelationKey rename and redundant
enqueueStatus field; reason already distinguishes success from
enqueue_failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants