feat(router): move emoji reactions from worker to router for instant feedback#421
Conversation
|
@aaight resolve conflicts |
Request AddressedWhat was askedResolve merge conflicts with the Changes Made
Verification
|
Merge origin/dev into feature/router-immediate-reactions, resolving the import conflict in src/router/index.ts to include both the new pre-actions module from dev and the reactions module from this branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Conflicts resolved ✅ Merged |
|
🔍 Reviewing PR... |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — clean implementation that follows established router patterns (notifications.ts, pre-actions.ts) for fire-and-forget platform API calls.
Architecture: The new reactions.ts module correctly mirrors the credential resolution, error handling, and dispatch patterns used by notifications.ts. The decision to use raw fetch() (avoiding client library dependencies in the router image) is consistent with the existing approach.
Correctness verified:
void sendAcknowledgeReaction(...).catch(...)is idiomatic fire-and-forget — doesn't block the 200 response to the webhook provider- GitHub reaction handler correctly early-returns for non-comment events (
check_suite,pull_request, etc.), avoiding conflict with the existingaddEyesReactionToPRpre-action - JIRA fallback path (reactions API → comment) handles all failure modes gracefully
- JIRA cloudId cache keyed by
baseUrlis an improvement over the worker's single-value cache for multi-project setups - Different emojis (💭 router vs 👀 worker) for Trello makes the dual-reaction transitional period distinguishable
Tests: 20 tests comprehensively cover all platforms, payload type guards, credential failures, API errors, cache behavior, and fallback paths.
No issues found.
Summary
src/router/reactions.tsmodule — router-side reaction dispatch using rawfetch()following thenotifications.tspattern, supporting Trello (💭), GitHub (👀), and JIRA (💭) reactionssendAcknowledgeReaction()calls beforeaddJob()in Trello, GitHub, and JIRA POST routesTest plan
sendAcknowledgeReaction()— all platforms, payload type guards, error handling, credential failuresnpm testpasses (46/46 router tests)npm run lint:fixpasses (no errors)npm run typecheckpasses (zero errors)Key decisions
repoFullNameas the identifier tosendAcknowledgeReaction(instead of projectId) since GitHub jobs don't carry a projectId. The reaction module callsfindProjectByRepo()internally to resolve credentials._edge/tenant_infocalls on the router hot path. Failure returns null → fallback comment.acknowledgeWithReaction()kept: Both router and worker may react. All platforms handle duplicate reactions idempotently. Worker-side can be removed later once router reactions are proven stable.fetch()+ existing credential helpers.Related
Card: https://trello.com/c/6996254bcee54ec08f63ded2
🤖 Generated with Claude Code