Fix: QQReplyMessage message_type / msg_idx 应可空 - #228
Open
Yushu2606 wants to merge 1 commit into
Open
Conversation
Real production traffic: replying to a message that itself contains a nested quote chain produces a msg_elements entry that's just a synthesized summary blob (content only, no message_type/msg_idx) -- pydantic validation failed with "Field required" for both, and the event silently failed to parse (caught by dispatch_event's own try/except, so it doesn't crash the process, but the message is never delivered to any handler). Verified against the exact failing payload from a production traceback: previously raised ValidationError, now parses correctly with message_type=None/msg_idx=None. Confirmed the normal case (both fields present) is unaffected.
message_type/msg_idx 应可空
message_type/msg_idx 应可空message_type / msg_idx 应可空
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #217
回复一条本身带有多层嵌套引用链的消息时,生成的
msg_elements条目仅为合成的摘要大文本块(只有内容,缺少message_type、msg_idx字段)。Pydantic 校验抛出两个字段的“字段必填”错误,事件解析静默失败。该错误被
dispatch_event内部的 try‑except 捕获,因此不会造成进程崩溃,但该消息永远不会投递到任何业务处理器。已对照生产报错堆栈里的原始异常载荷完成验证:此前会抛出
ValidationError;现在当message_type=None、msg_idx=None时可以正常解析。已确认普通正常场景(两个字段均存在)不受改动影响。