Skip to content

Commit f9d824d

Browse files
committed
ref(slack): Add warning log for unrecognized channel types in has_history_scope
Log a warning when has_history_scope falls through to the default return without matching any known channel type, making it easier to diagnose unexpected conversation types from the Slack API.
1 parent d0b0951 commit f9d824d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sentry/integrations/slack/integration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,17 @@ def has_history_scope(self, channel_id: str) -> bool:
284284
# always read its own conversation history.
285285
if is_im:
286286
return True
287-
288287
if is_private:
289288
return SlackScope.GROUPS_HISTORY in installed_scope_set
290289
if is_channel:
291290
return SlackScope.CHANNELS_HISTORY in installed_scope_set
292291

293292
# Shouldn't reach here unless channel_info is empty (most likely
294293
# an API error or an unrecognized conversation type).
294+
_logger.warning(
295+
"slack.has_history_scope.unrecognized_channel_type",
296+
extra={"channel_id": channel_id, "channel_info": channel_info},
297+
)
295298
return False
296299

297300
def get_conversations_info(

0 commit comments

Comments
 (0)