Repository navigation
fix(mattermost): unnamed media uploads lose file extensions - #119535
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 3:27 AM ET / 07:27 UTC. ClawSweeper reviewWhat this changesThe PR derives a MIME-based extension for unnamed Mattermost media uploads while preserving loader-provided filenames. Merge readinessKeep open. Current main still gives unnamed Mattermost uploads the fallback name Priority: P2 Review scores
Verification
How this fits togetherThe Mattermost plugin loads outbound media, chooses its multipart filename, uploads it to Mattermost, and then posts the resulting file in a channel. The selected fallback filename affects how receiving clients recognize the attachment. flowchart LR
A[Outgoing media URL] --> B[Media loader]
B --> C[Mattermost send path]
C --> D[Filename fallback]
D --> E[Multipart file upload]
E --> F[Channel post]
F --> G[Mattermost client]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +1, Tests +70. Total +71 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the plugin-local fallback and land it through normal exact-head merge gates; a new cross-channel filename-policy abstraction would add unnecessary SDK surface. Do we have a high-confidence way to reproduce the issue? Yes—current main’s identified fallback emits Is this the best way to solve the issue? Yes—the transport owns multipart filename selection, while the existing SDK owns MIME normalization; the patch preserves named files and unknown-MIME behavior without creating duplicate shared policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3faa2b088823. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where Mattermost uploads without a source filename were sent as the extensionless name
upload, even when their MIME type identified the file format.Why This Change Was Made
Unnamed Mattermost media now uses the shared
extensionForMimemapping, matching the established Slack upload behavior from #119399. Explicit source filenames remain unchanged.User Impact
Mattermost clients receive useful names such as
upload.pngfor unnamed media, so file type handling does not depend only on the MIME header.Evidence
8fd663357cdc3113c88da6901b86705bf3cc07ab:sendMessageMattermostsent named and unnamed PNG fixtures through the real multipart uploader to a localhost Mattermost API.mattermost/mattermost-preview:11.10.0: current main stored unnamed PNG asupload; exact head stored it asupload.png; both preservedoperator-name.bin. Run: https://crabbox.openclaw.ai/portal/runs/run_a7a9049ee0dcnode scripts/run-vitest.mjs extensions/mattermost/src/mattermost/send.test.ts extensions/mattermost/src/channel.send-loopback.test.ts: 2 files and 51 tests passed. Run: https://crabbox.openclaw.ai/portal/runs/run_3a090d9948e3proof-live.ts
AI-assisted: built with Codex
Punchcard-Session: clear-orchard-lantern-bc