Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potato backfill command #79

Open
untitaker opened this issue Jun 21, 2023 · 3 comments
Open

Potato backfill command #79

untitaker opened this issue Jun 21, 2023 · 3 comments
Labels

Comments

@untitaker
Copy link
Member

When I receive potatoes in a channel, I realize too late that GibPotato isn't invited in the channel yet.

Idea: When GibPotato is invited, it fetches msgs from the past (up to a point, 24h should be more than enough) and backfills potatoes. Preferrably skipping (or batching) all the notifications that generates.

@cleptric
Copy link
Member

Not a terrible idea, as this is something I also encountered quite often 😅

A few things we would need to consider when implementing this:

  • Currently, we do not store the message content anywhere. To make this feature work, we could think about hashing the raw message string and adding it to a new messages table column.
    Otherwise, we would not know which messages we have already processed. There might be some edge cases with edited messages, not a big one in the case of Sentry's Slack (You can edit a message up to 5 minutes after posting) but maybe for others.
  • From a Slack API perspective, this would require one API call only, as far as I can tell, so this solves some concerns about getting rate-limited https://api.slack.com/methods/conversations.history

@untitaker
Copy link
Member Author

Otherwise, we would not know which messages we have already processed.

do we store all messages from slack regardless of whether they have a reaction? that's a really large table!

we could store a timestamp per-channel of the last message we processed, that should be enough to deduplicate when the bot leaves and joins repeatedly

@cleptric
Copy link
Member

No, we only create a message record if the message was sampled by potal.
So it either needs to contain a 🥔 or a 🥔 reaction was added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants