Repository navigation
Keep captured and picked media out of device backups - #14
Merged
Merged
Conversation
Since #12, captures and gallery picks live in persistent app storage instead of cache/temp. On Android that was filesDir, which Auto Backup copies to Google Drive in a stock NativePHP app. On iOS the gallery copy path never set isExcludedFromBackup, so picked files went to iCloud. Android now writes to noBackupFilesDir, which is persistent and never backed up. iOS sets isExcludedFromBackup on gallery files like the photo and video paths already do. The storage docs were stale, so they now list the real folders and tell apps to copy what they need and delete the original, since the plugin never cleans these up. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Follow-up to #12. Moving captures out of cache/temp made them persistent, which also put them in device backups.
Android: files went to
filesDir/CameraandfilesDir/Gallery. A stock NativePHP app hasallowBackup="true"with empty backup rules, so those were uploaded to Google Drive by Auto Backup. They now go tonoBackupFilesDir/CameraandnoBackupFilesDir/Gallery. That folder is app-private, not purged by the OS, and never backed up.iOS: the photo and video paths already set
isExcludedFromBackup, butcopyFileToCache(gallery picks) didn't, so picked files were backed up to iCloud. It now sets the flag on the final file.Docs: the Storage Locations sections in the README and Boost guidelines still listed
{cache}andPhotos//Videos/folders the code doesn't use. They now show the real paths and say that the plugin never deletes these files, so apps should copy what they need andunlink()the original.#12 isn't in a release yet, so no shipped installs have files in the backed-up folders.
Please test on a real Android device: take a photo and check
file_exists($path)in PHP. Issue #8 said PHP couldn't readcacheDir. I think the file was actually purged before PHP read it, since PHP runs in-process with noopen_basedir, andno_backupsits next tofiles/andcache/. If PHP really is limited tofiles/, this change would break PHP access again. Nothing here has been built or run on a device yet.🤖 Generated with Claude Code