Recover screenshots after app reinstall or update#408
Merged
Conversation
Screenshots vanished from feedback submitted after an app reinstall or update. On iOS the data container GUID is reassigned on every install (Apple TN2406), so the absolute path persisted at capture time points at a directory that no longer exists, even though the file itself was migrated under the same name. retrieveAllPendingItems now rebuilds each on-disk screenshot path from the current documents directory and the persisted file name. The directory is resolved only when an item actually has a screenshot on disk, so screenshot-less feedback never touches the path_provider channel.
5f99b32 to
48ffb3f
Compare
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
Screenshots vanished from feedback submitted after an app reinstall or update.
On iOS the data container GUID is reassigned on every install (Apple TN2406). The absolute screenshot path persisted at capture time points at a directory that no longer exists — even though the file itself was migrated under the same name. When loading pending feedback, the file couldn't be found and the screenshot was dropped.
Fix
retrieveAllPendingItemsnow rebuilds each on-disk screenshot path from the current documents directory and the persisted file name, instead of trusting the stored absolute path.The current directory is resolved lazily — only when an item actually has a screenshot on disk — so screenshot-less feedback (the common case) never touches the
path_providerplatform channel.Before
After
Tests
pending_feedback_item_storage_test.dartsimulating the iOS container path change (TN2406).offline_feedback_test.dartcovers v2/v3 offline feedback with screenshots end-to-end.