fix: remove unnecessary users.info calls from usergroup grants - #88
Conversation
The Grants method was calling users.info for every group member just to build a user resource and extract its ID — but the grant only needs the resource ID, which is constructed from the Slack user ID we already have from the member list. This eliminates all per-member API calls from the grants loop, removing the rate limit problem entirely for usergroup grants. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
408fbbc to
871b5c1
Compare
|
Claude finished @btipling's task in 1m 0s —— View job PR Review: Remove unnecessary users.info calls from usergroup grants
Verdict: Approve ✅ This is a clean, well-scoped optimization. The change is correct and safe. What changedIn Why this is correctThe resource ID for a user is determined by the resource type + the Slack user ID. Both paths produce identical IDs:
The IDs will match because they use the same resource type and the same Slack user ID string. Other observations
No issues found. Nice improvement — eliminates N API calls per page of usergroup members. |

Summary
users.infoAPI calls from usergroup grantsContext
Resolves CXH-1301
The Grants method was calling
users.infofor every group member to build a full user resource, then only usingur.Idfrom it to create the grant. The user ID needed for the resource ID is the same Slack user ID we already have fromGetUserGroupMembersContext. The full user profile fetch was completely unnecessary.Test plan
🤖 Generated with Claude Code