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

View File

@@ -161,9 +161,9 @@ class FeishuModule(_ModuleBase, _MessageBase[Feishu]):
title: Optional[str] = None,
buttons: Optional[List[List[dict]]] = None,
metadata: Optional[dict] = None,
) -> bool:
) -> Optional[bool]:
if channel != self._channel:
return False
return None
for conf in self.get_configs().values():
if source != conf.name:
continue
@@ -296,7 +296,7 @@ class FeishuModule(_ModuleBase, _MessageBase[Feishu]):
message_id: str,
reaction_id: str,
source: str,
) -> bool:
) -> Optional[bool]:
client_config = self.get_config(source)
if not client_config:
return False

View File

@@ -837,7 +837,10 @@ class Feishu:
return None
data = getattr(response, "data", None)
logger.info(f"_send_message 飞书回复消息成功data={data}")
logger.info(
"_send_message 飞书回复消息成功message_id=%s",
getattr(data, "message_id", None),
)
return {
"success": True,
"message_id": getattr(data, "message_id", None),
@@ -880,7 +883,10 @@ class Feishu:
return None
data = getattr(response, "data", None)
logger.info(f"_reply_message 飞书回复消息成功data={data}")
logger.info(
"_reply_message 飞书回复消息成功message_id=%s",
getattr(data, "message_id", None),
)
return {
"success": True,
"message_id": getattr(data, "message_id", None),