Repository navigation
Mob.Storage.exclude_from_backup/1: keep re-downloadable data out of iCloud backups (bezalel-lac.3) - #209
Merged
Conversation
…e-downloadable data out of iCloud backups (bezalel-lac.3)
…vice-to-device transfer; drop the literal-badarg test (type warning)
GenericJam
added a commit
to GenericJam/bezalel_mob
that referenced
this pull request
Oct 16, 2026
… Bezalel.Packs.Storage.prepare/0 at every start creates and excludes the directory, then moves what older builds left in Documents/packs (rename per file, copy+size check across volumes, resumable, symlinks as links, collisions left alone); Bezalel.Study.DB.dir/0 stays the one name for it; mob pinned to GenericJam/mob#209's merge for Mob.Storage.exclude_from_backup/1 (bezalel-lac.3; Linear full)
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.
Tracked as bead
bezalel-lac.3(no MOB issue: the Linear workspace has hit its free-tier issue limit).Why
Bezalel keeps 182-607 MB of re-downloadable study packs in
Mob.data_dir(), which on iOS is Documents and is backed up to iCloud. Apple rejects apps that back up data they can download again. Mob had no way to setNSURLIsExcludedFromBackupKey, andMob.Storage's docs said nothing about:documentsbeing backed up.What
Mob.Storage.exclude_from_backup(path) :: :ok | {:error, :enoent | String.t()}andMob.Storage.excluded_from_backup?(path) :: boolean().NSURL fileURLWithPath:isDirectory:thensetResourceValue:@YES forKey:NSURLIsExcludedFromBackupKey/getResourceValue:(fresh URL per call, so the query reads the file system, not NSURL's cache). Files and directories; a directory's flag covers its contents.:ok/false, no effect. Generated apps setandroid:allowBackup="false"; the docs say what an app that enables backup must do (backup rules XML). NoMobBridge.ktchange.:ok/false.{:error, :enoent}on every platform (checked in Elixir, so it matchesMob.Storage's other posix errors).nif_funcstable andandroid/jni/mob_nif.zig's table; Erlang stubs; classified as returns-promptly innif_scheduling_completeness_test.exs.Mob.Storagemoduledoc andguides/device_capabilities.mdnow say which locations are backed up, with a "Keeping downloaded data out of backups" section.Verified
Throwaway
mix mob.new nbprobe --blank --localapp on this branch, probe inon_start:before=false result=:ok after=true inner=false missing={:error, :enoent}; relaunched:before=true. Host-sidexattron the container directory showscom.apple.metadata:com_apple_backup_excludeItem: com.apple.MobileBackup.result=:ok after=false missing={:error, :enoent}; the zig NIFs built and registered.mix test test/mob/storage_test.exs test/mob/nif_scheduling_completeness_test.exs: 28 passed.Review
reviewer subagent (Codex rate-limited until 5:26 PM): MERGE. Its two optional notes (Android 12+ device-to-device transfer ignores
allowBackup="false"; a literal-badarg test emitting a type warning) are fixed in 8b9be6c; re-review: MERGE.CI: green (mix_audit failed once at
deps.getwith "Unknown package jump_credo_checks in lockfile", a Hex fetch flake; passed on rerun).