fix: ensure stop_streaming waits for inflight initial flush before final edit; improve message edit/delete return types and logging

- Update stop_streaming logic to await inflight initial flush task, preventing duplicate message sends on stream stop
- Change message edit/delete methods to return Optional[bool] for clearer channel mismatch handling
- Refine Feishu logging to include message_id instead of full data object
- Suppress allowed_objects warnings in __init__.py
- Add test to verify stop_streaming waits for inflight flush before final edit
- Update .pylintrc to use 'E' for error enabling
This commit is contained in:
jxxghp
2026-05-13 10:11:31 +08:00
parent 4c16704ca2
commit 6fb6996d81
9 changed files with 100 additions and 25 deletions
+5 -5
View File
@@ -527,7 +527,7 @@ class SlackModule(_ModuleBase, _MessageBase[Slack]):
source: str,
message_id: str,
chat_id: Optional[str] = None,
) -> bool:
) -> Optional[bool]:
"""
删除消息
:param channel: 消息渠道
@@ -536,10 +536,10 @@ class SlackModule(_ModuleBase, _MessageBase[Slack]):
:param chat_id: 聊天ID(频道ID
:return: 删除是否成功
"""
if channel != self._channel:
return None
success = False
for conf in self.get_configs().values():
if channel != self._channel:
break
if source != conf.name:
continue
client: Slack = self.get_instance(conf.name)
@@ -559,7 +559,7 @@ class SlackModule(_ModuleBase, _MessageBase[Slack]):
title: Optional[str] = None,
buttons: Optional[List[List[dict]]] = None,
metadata: Optional[dict] = None,
) -> bool:
) -> Optional[bool]:
"""
编辑消息
:param channel: 消息渠道
@@ -572,7 +572,7 @@ class SlackModule(_ModuleBase, _MessageBase[Slack]):
:return: 编辑是否成功
"""
if channel != self._channel:
return False
return None
for conf in self.get_configs().values():
if source != conf.name:
continue