Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

bug: Data loss risk on iOS - the Database folder is excluded from backups

オープン
#613 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
ios, sqlite, swift

調査の方向性

ios/Plugin/Utils/UtilsFile.swift の50行目付近から開始します。ここでは iOSDatabaseLocation ディレクトリが作成され、そのバックアップフラグが設定されています。Library/Database がバックアップ対象としてどのようにマークされているかを確認し、その後、iCloud バックアップ、コンピュータのバックアップ、デバイスの転送時にデータベースが保持されるように動作を変更します。完了条件は、データベースディレクトリがバックアップから除外されなくなることです。

索引モデルが issue の本文から書いたものです。

説明

bug/fix needs: triage

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 はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

capacitor-community/sqlite のほかの issue

capacitor-community/sqlite の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。