bug: Data loss risk on iOS - the Database folder is excluded from backups
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- ios, sqlite, swift
- 領域
- databases, mobile-dev
調査の方向性
ios/Plugin/Utils/UtilsFile.swift の50行目付近から開始します。ここでは iOSDatabaseLocation ディレクトリが作成され、そのバックアップフラグが設定されています。Library/Database がバックアップ対象としてどのようにマークされているかを確認し、その後、iCloud バックアップ、コンピュータのバックアップ、デバイスの転送時にデータベースが保持されるように動作を変更します。完了条件は、データベースディレクトリがバックアップから除外されなくなることです。
索引モデルが issue の本文から書いたものです。
説明
Plugin version:
6
Platform(s):
iOS
Current behavior:
On iOS, our app specifies it's own iOSDatabaseLocation directory:
Library/Database
But I see that, just after the directory is created, the isExcludedFromBackup flag on that directory is set to true. See https://github.com/capacitor-community/sqlite/blob/891377f344924de80003287f172de24984e8b74b/ios/Plugin/Utils/UtilsFile.swift#L50
Because of this, none of the databases in that directory will ever get backed up, to iCloud or to a computer. I'm pretty sure that this will also exclude the files from a direct device to device transfer.
As a mitigation, our app explicitly sets the flag back to false, but we weren't expecting the behaviour. As a result, our users are at risk of data loss if they transfer data to a new iPhone before updating our app. Not cool.
Solution
I see that historically, the flag was set purposefully to hide the database from iTunes (https://github.com/capacitor-community/sqlite/issues/207), but that is completely misguided as in practice, there's now no way for the dbs in that folder to be transferred to other devices as long as the flag remains...
Happy to discuss. iOS backups are a specialty of mine, used to work in that domain specifically.
- 主要言語
- Swift
- スター
- 661
- フォーク
- 158
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
capacitor-community/sqlite のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
capacitor-community/sqlite#700 · コメント 1 件 · リアクション 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
capacitor-community/sqlite#693 · リアクション 7 件 ·
-
bug/fix needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
capacitor-community/sqlite#690 ·
-
feature needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
capacitor-community/sqlite#689 ·
-
bug/fix needs: triage
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
capacitor-community/sqlite#685 ·
capacitor-community/sqlite の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
auth type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
googleapis/google-cloud-swift#1260 ·
メンテナーはふだん 1 日以内に返信
-
catalog-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
0. Needs triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
steipete/RepoBar#140 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信