elastic / elastic/connectors

Slack connector cannot ingested archived channels

Open
#1,972 6 comments 0 reactions 0 assignees View on GitHub
bug community-driven slack
Dominant language
Python
Stars
133
Forks
205
Avg merge
16h 3m
Merged PRs (30d)
102

Description

## Bug Description
The slack connector uses a Bot Token. Bots need to be in a channel in order to retrieve the message history for that channel. Unfortunately, it seems that when a channel is archived, Bots are ejected from the channel membership. So even if the bot was originally part of the channel, as soon as it is archived, the bot can no longer access the history.

### To Reproduce
1. Create a new slack channel
2. invite the bot for the connector
3. post a message
4. run a sync - you should see the message
5. archive the channel
6. run a sync - the message gets deleted

## Expected behavior
Archived channel messages should remain indexed

## Screenshots

Screenshot 2023-12-08 at 10 29 28 AM

## Environment
Version 8.11.2

## Additional context
I've filed a support request with Slack, as this doesn't look like a logical error on our end, unless the error is just using bot tokens. But the whole purpose of archived channels is to leave the content searchable, so it feels like they wouldn't have intended this.

Contributor guide

Open the contributing guide

Research direction

Start with the Slack connector's sync behavior and investigate how archived channels are handled when the bot token can no longer access their history. Reproduce the listed channel lifecycle, then verify that a subsequent sync preserves the archived channel's indexed messages instead of deleting them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.