Skip to content

fix(github): correctly trigger removeReaction in multi-tenant mode#250

Merged
matchai merged 1 commit intomainfrom
fix/github-remove-reaction-multi-tenant
Mar 16, 2026
Merged

fix(github): correctly trigger removeReaction in multi-tenant mode#250
matchai merged 1 commit intomainfrom
fix/github-remove-reaction-multi-tenant

Conversation

@matchai
Copy link
Member

@matchai matchai commented Mar 16, 2026

In multi-tenant mode (GitHub App without a fixed installationId), initialize() skips _botUserId auto-detection because there's no global octokit client. This leaves _botUserId as null, so removeReaction never finds a matching reaction to delete — the reactions.find() filter always fails.

Fixes this by lazily detecting _botUserId via users.getAuthenticated() on the per-installation octokit client that removeReaction already has available. The result is cached, so subsequent calls skip the extra API call.

@vercel
Copy link
Contributor

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview, Comment, Open in v0 Mar 16, 2026 7:43am
chat-sdk-nextjs-chat Ready Ready Preview, Comment, Open in v0 Mar 16, 2026 7:43am

@matchai matchai changed the title fix(github): lazily detect botUserId in removeReaction for multi-tenant mode fix(github): correctly trigger removeReaction in multi-tenant mode Mar 16, 2026
@matchai matchai marked this pull request as ready for review March 16, 2026 07:45
@matchai matchai merged commit 01bd059 into main Mar 16, 2026
10 checks passed
@matchai matchai deleted the fix/github-remove-reaction-multi-tenant branch March 16, 2026 07:49
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