mattermost-mobile-upstream/app/components/post_draft/uploads
Mattermost Build d9df0cdf3e
[MM-69129] Prevent crash on nameless attachment (#10091) (#10134)
* [MM-69129] Prevent crash on nameless attachment.

A draft attachment persisted without a name or an extension made
`isImage` call `extractExtension(undefined)`, throwing on every render of
the channel and of the global Drafts screen. Guard against it so the
draft renders as a plain file card that the user can remove.

* [MM-69129] Exercise the upload item tests against the real file utils

Both suites stubbed `isImage` and `getFormattedFileSize`, which are pure
functions, so they asserted states the component can never see and could
not have caught this crash. Drop the mocks and let each fixture decide
which branch renders.

(cherry picked from commit 876af76f36)

Co-authored-by: Jesse Hallam <jesse@thehallams.ca>
2026-09-07 08:26:41 +03:00
..
upload_item [MM-69129] Prevent crash on nameless attachment (#10091) (#10134) 2026-09-07 08:26:41 +03:00
index.test.tsx MM-64415 Attachment style updated for draft and Edit post screen (#8961) 2025-07-07 16:24:27 +05:30
index.tsx [MM-66908] Fix error display for file upload in low bandwidth (#9418) 2026-03-25 12:44:36 -04:00