Skip to content

fix(mobile): stop iOS crash when attaching images - #380

Merged
patroza merged 1 commit into
fork/devfrom
t3code/fix-ios-mobile-file-add-crash
Aug 8, 2026
Merged

patroza merged 1 commit into
fork/devfrom
t3code/fix-ios-mobile-file-add-crash

Conversation

@patroza

@patroza patroza commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • iOS crashed on the composer + attachment button because pickComposerImages called requestMediaLibraryPermissionsAsync() while the app ships with photosPermission: false (no NSPhotoLibraryUsageDescription).
  • Open the system image picker directly (no media-library permission preflight), wrap launch failures in a structured error, and add unit coverage that the permission API is never called.

Test plan

  • vp test run apps/mobile/src/lib/composerImages.test.ts (8 passed)
  • On iOS: expand thread composer → tap + → system photo picker opens (no crash)
  • Cancel picker → no attachment, no error toast
  • Pick an image → attachment strip shows preview

The + attachment control called requestMediaLibraryPermissionsAsync while
the app ships with photosPermission: false, so iOS has no
NSPhotoLibraryUsageDescription and hard-crashes on tap. Open the system
picker directly and cover the path with unit tests.
@patroza
patroza merged commit ee09e67 into fork/dev Aug 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant