From 782e71a0e3763d4c4001a00f7b9f89b8a60e8896 Mon Sep 17 00:00:00 2001 From: Indent Date: Thu, 29 Oct 2026 12:38:47 +0000 Subject: [PATCH] chatinfo: don't refetch missing bots on every message --- pkg/connector/chatinfo.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkg/connector/chatinfo.go b/pkg/connector/chatinfo.go index f1cc391..aef0d99 100644 --- a/pkg/connector/chatinfo.go +++ b/pkg/connector/chatinfo.go @@ -574,6 +574,17 @@ func (s *SlackClient) fetchUserInfo(ctx context.Context, userID string, lastUpda botInfo, err = s.Client.GetBotInfoContext(ctx, slack.GetBotInfoParameters{ Bot: userID, }) + var slackErr slack.SlackErrorResponse + if errors.As(err, &slackErr) && slackErr.Err == "bot_not_found" { + zerolog.Ctx(ctx).Debug().Str("bot_id", userID).Msg("Bot not found, not retrying until next sync interval") + return &bridgev2.UserInfo{ + IsBot: ptr.Ptr(true), + ExtraUpdates: func(ctx context.Context, ghost *bridgev2.Ghost) bool { + ghost.Metadata.(*slackid.GhostMetadata).LastSync = jsontime.UnixNow() + return true + }, + }, nil + } } else if s.IsRealUser { var infos map[string]*slack.User infos, err = s.Client.GetUsersCacheContext(ctx, s.TeamID, slack.GetCachedUsersParameters{