fix(mobile): use legacy expo-media-library/file-system imports#29435
Merged
Conversation
expo 57 root exports replace legacy methods (saveToLibraryAsync, deleteAsync) with shims that throw at runtime while keeping their types, so tsc stayed green. Save-to-camera-roll threw immediately after download, leaving the progress bar stuck at 100% on iOS.
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
Saving images from chat on iOS broke after the expo 57 bump: the download bar fills, then nothing happens and the transfer indicator stays stuck.
Root cause
expo 57 replaced the root-export legacy methods of
expo-media-libraryandexpo-file-systemwith deprecation shims that throw at runtime while keeping their TypeScript types, sotscstayed green.MediaLibrary.saveToLibraryAsyncthrew immediately after download, which skippedsetAttachmentMobileSaving(ordinal, false)and left the UI stuck.FileSystem.deleteAsyncwas also throwing (swallowed by a try/catch, leaking the temp file).Fix
Import both modules from their
/legacysubpaths, which keep the real implementations. The new class-based APIs (Asset.create(),File) are the eventual migration path, butAsset.createmay require broader photo permissions than the add-onlysaveToLibraryAsync, so this keeps exact prior behavior.Validation
yarn lint/yarn tscpass🤖 Generated with Claude Code