Skip to content

Commit 55f9397

Browse files
committed
fix(slack): use explicit None-coalesce for DM thread_ts at encode time
Per CLAUDE.md port rule, prefer 'x if x is not None else default' over 'x or default'. Functionally identical here (only falsy value is the intended empty string) and keeps the SlackThreadId(thread_ts: str) guarantee that pyrefly checks.
1 parent 2b6c092 commit 55f9397

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/chat_sdk/adapters/slack/adapter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,12 @@ def _handle_block_actions(self, payload: dict[str, Any], options: WebhookOptions
16241624

16251625
thread_id = ""
16261626
if channel and (thread_ts or message_ts):
1627-
thread_id = self.encode_thread_id(SlackThreadId(channel=channel, thread_ts=thread_ts or ""))
1627+
thread_id = self.encode_thread_id(
1628+
SlackThreadId(
1629+
channel=channel,
1630+
thread_ts=thread_ts if thread_ts is not None else "",
1631+
)
1632+
)
16281633

16291634
is_ephemeral = (payload.get("container") or {}).get("is_ephemeral") is True
16301635
response_url = payload.get("response_url")

0 commit comments

Comments
 (0)