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

chore(slack): Remove redundant thread ID generation #1910

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions backend/chainlit/slack/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import re
import uuid
from datetime import datetime
from functools import partial
from typing import Dict, List, Optional, Union

Expand Down Expand Up @@ -339,12 +338,6 @@ async def handle_app_mentions(event, say):

@slack_app.event("message")
async def handle_message(message, say):
thread_id = str(
uuid.uuid5(
uuid.NAMESPACE_DNS,
message["channel"] + datetime.today().strftime("%Y-%m-%d"),
)
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to keep the per day segmentation? If not this means that we will get one thread per channel which can grow pretty fast.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thread_ts is a thread message key, which means we will get one chainlit thread per Slack thread.

https://api.slack.com/messaging/retrieving
image

thread_ts = message.get("thread_ts", message["ts"])
thread_id = str(uuid.uuid5(uuid.NAMESPACE_DNS, thread_ts))

Expand Down
Loading