allow bot membership in gdm streams#4871
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryAllow bot membership in GDMs; refine auth handling
Written by Cursor Bugbot for commit c173f49. This will update automatically on new commits. Configure here. |
|
Found 1 test failure on Blacksmith runners: Failure
|
| // in bot membership events. | ||
| // bounce, we want to verify that the initiator of the membership change has appropriate permissions. | ||
| // NOTE: DMs use a special inception-based flow for bots. GDMs don't have ownership hierarchy, so bot | ||
| // authorization is handled by gdmBotSponsorEntitlements() on the GDM stream side instead of here. |
There was a problem hiding this comment.
Bots cannot self-leave GDM streams due to unhandled case
Medium Severity
When a bot initiates its own leave from a GDM, chainAuthForUserMembership() calls addRemoveChannelChainAuthForApp() (since Inviter equals the bot's own address). However, addRemoveChannelChainAuthForApp() only handles STREAM_CHANNEL_BIN and returns an error for GDM streams: "Invalid stream for app join, wanted channel". The PR updated ownerChainAuthForInviter() to return nil, nil for GDMs (handling member-initiated bot additions) but didn't update the self-initiated path. Bots can join GDMs but cannot leave on their own.
Additional Locations (1)
texuf
left a comment
There was a problem hiding this comment.
If it feels good ship it i will review it thoroughly on friday when im back.
Allows the user stream side of bot gdm. Stacked on #4860
validUserMembershipStream()for app usersownerChainAuthForInviter()(no ownership check needed - authorization is handled by gdmBotSponsorEntitlements() on the GDM stream side)Claude take on why: