Skip to content

chatinfo: don't use batch user resync queue for bot IDs#77

Open
iFixRobots wants to merge 1 commit intomainfrom
fix/skip-bot-batch-resync
Open

chatinfo: don't use batch user resync queue for bot IDs#77
iFixRobots wants to merge 1 commit intomainfrom
fix/skip-bot-batch-resync

Conversation

@iFixRobots
Copy link
Copy Markdown

Problem

B-prefix bot/app ghost IDs (e.g. BGT7QUP3L for Google Drive) on cookie-based logins (IsRealUser = true) never get IsBot set to true, so com.beeper.bridge.is_network_bot is permanently false.

This causes clients to include Slack app bots in nonBotMembers, making them appear as the DM partner instead of the actual human contact.

Cause

GetUserInfo unconditionally routes all named ghosts to userResyncQueue on cookie-based logins. The queue consumer calls syncManyUsersGetUsersCacheContext, which is a users-only Slack API that silently ignores B-prefix bot IDs. So wrapUserInfo is never called for bots and IsBot stays false.

The correct path (fetchUserInfoGetBotInfoContext) exists but is dead code for cookie logins once a ghost has a name.

Fix

Skip the batch queue for B-prefix IDs so they fall through to fetchUserInfo, which correctly calls GetBotInfoContext and sets isBot = true. This matches the existing userID[0] == 'B' check already used in fetchUserInfo (line 432).

B-prefix bot/app IDs were being routed to the batch user resync queue
on cookie-based logins. GetUsersCacheContext is a users-only API that
silently ignores bot IDs, so IsBot was never set and is_network_bot
was permanently false for all Slack app ghosts.

Skip the queue for B-prefix IDs so they fall through to fetchUserInfo,
which correctly calls GetBotInfoContext and sets isBot = true.
@iFixRobots iFixRobots requested a review from tulir April 22, 2026 12:17
@tulir tulir changed the title fix: skip batch user resync queue for bot IDs chatinfo: don't use batch user resync queue for bot IDs Apr 22, 2026
@iFixRobots iFixRobots self-assigned this Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants