fix(ios): dynamically migrate absolute file paths after app update#502
Merged
RadicalMuffinMan merged 1 commit intoJun 11, 2026
Merged
Conversation
When an iOS application is updated, the sandbox container UUID changes. Any absolute paths stored in the offline database pointing to the app's Documents folder (such as downloaded media files and local artwork images) become invalid, causing downloaded media to appear missing. This commit resolves the issue by: 1. Adding an `updateItemPaths` method to `OfflineRepository`. 2. Implementing a startup migration helper in `injection.dart` to automatically translate stored absolute paths containing the old UUID to the current container path. 3. Adding unit tests for the iOS path migration helper.
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.
Pull Request
Summary
Resolves an issue on iOS where downloaded offline media files and artwork images become inaccessible after the app is upgraded. Because iOS updates regenerate the application's container UUID, any stored absolute paths in the offline database referencing the old container path break.
This change introduces a startup migration routine that queries the current application documents path and automatically translates any stored absolute database paths containing a legacy UUID to the current container path, while leaving non-sandbox and other platforms' paths untouched.
Related Issues
Link related issues or tickets separated by commas.
Type of Change
Changes Made
updateItemPathsinOfflineRepositoryto update path fields (localFilePath,posterPath,backdropPath,logoPath,thumbPath) of a downloaded item without modifying other columns.migrateIosPathhelper and_migrateIosPathsroutine ininjection.dartto query, translate, and update all stored paths to match the current Documents directory container on iOS startup.path_migration_test.dartto verify path translation behavior.Platform
Testing
Describe how this change was tested.
Checklist