mattermost-mobile-upstream/app/components/upload_item_shared
Jesse Hallam 876af76f36
[MM-69129] Prevent crash on nameless attachment (#10091)
* [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.
2026-08-24 12:10:59 -03:00
..
adapters.test.ts (Android) Common component for upload item for main application and share extension (#9028) 2025-09-11 12:54:54 +05:30
adapters.ts (Android) Common component for upload item for main application and share extension (#9028) 2025-09-11 12:54:54 +05:30
constants.ts (Android) Common component for upload item for main application and share extension (#9028) 2025-09-11 12:54:54 +05:30
index.test.tsx [MM-69129] Prevent crash on nameless attachment (#10091) 2026-08-24 12:10:59 -03:00
index.tsx Migrate from RNN to Expo router (#9402) 2026-05-13 17:44:55 +08:00
remove_button.test.tsx (Android) Common component for upload item for main application and share extension (#9028) 2025-09-11 12:54:54 +05:30
remove_button.tsx (Android) Common component for upload item for main application and share extension (#9028) 2025-09-11 12:54:54 +05:30