mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-03 14:39:56 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user