fix: add md, markdown, json, yaml, yml, toml, log to MEDIA: file regex#32398
Closed
zywgit1 wants to merge 1 commit into
Closed
fix: add md, markdown, json, yaml, yml, toml, log to MEDIA: file regex#32398zywgit1 wants to merge 1 commit into
zywgit1 wants to merge 1 commit into
Conversation
The MEDIA:<path> extraction regex in extract_media() only recognized .txt and .csv as plain-text document extensions. This meant files with extensions like .md, .json, .yaml, .toml, and .log could never be delivered as file attachments — the regex silently dropped them. Added support for: md, markdown, json, yaml, yml, toml, log
Collaborator
This was referenced May 26, 2026
Contributor
|
Superseded by #34844, which consolidates this cluster. This PR widens the Closing as superseded — thanks for surfacing and helping pin down this bug; it was part of getting the full fix right. See #34844. |
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.
Problem
The
MEDIA:file-attachment regex ingateway/platforms/base.pyonly matched a limited set of file extensions (images, videos, audio, archives, office docs, txt). Common text-based formats like.md,.json,.yaml,.toml, and.logwere silently dropped — the gateway reported success but the file was never actually sent.Fix
Added
md|markdown|json|yaml|yml|toml|logto the media extension regex pattern.Testing
.mdfiles are now correctly sent via Feishusend_messageChanged
gateway/platforms/base.pyL2416: Extended the media file extension regex