fix(dingtalk): handle richText and replied media attachments - #1649
Open
wgqi1126 wants to merge 4 commits into
Open
fix(dingtalk): handle richText and replied media attachments#1649wgqi1126 wants to merge 4 commits into
wgqi1126 wants to merge 4 commits into
Conversation
added 2 commits
August 6, 2026 18:06
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.
Summary
richTextcallbacksdownloadCodefield and retainpictureDownloadCodeas a compatibility fallbackcore.Messagetext.repliedMsg.contentwhen users reply to a group file or picture and @mention the robotpicture/imagemessages toImagesand quoted files toFiles; use MIME detection as a fallback for new downloadable reply typesProblem
DingTalk group media reaches Stream robots in more than one callback shape:
msgtype=richText, with image download codes insidecontent.richText[].msgtype=text; the referenced media is nested undertext.repliedMsgwithmsgTypeandcontent.downloadCode.The adapter previously handled the outer text but silently dropped media in both shapes. It also selected
pictureDownloadCodewhen both rich-text code fields were present, while the real download API requiresdownloadCodefor these callbacks.Behavior
FileAttachmentImageAttachmentimage/Tests
go test ./platform/dingtalk -count=1go test -race ./platform/dingtalk -count=1go vet ./platform/dingtalkgo build ./cmd/cc-connectRegression coverage includes mixed rich text, multiple pictures with partial download failure, download-code precedence, reply-to-file, reply-to-picture, standalone picture aliases, file names, MIME types, and attachment bytes.