Report Core Data migration failures to Sentry
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- ios, swift
- 領域
- mobile, observability
調査の方向性
Read Modules/Sources/WordPressData/Swift/ContextManager.swift and CoreDataHelper.swift:284, then trace how the app connects error reporting to Sentry without relying on the app delegate. Cover failed step-by-step migration, store-open failure, and restoreStoreCopy errors, including the case where fallback migration succeeds. Done means each failure is reported and the unused SentryStartupEvent is removed if it still has no callers.
索引モデルが issue の本文から書いたものです。
説明
Core Data migration failures are only written to the app log. Sentry never hears about them, so we can't tell how often they happen.
Split out of #13014.
What happens
In ContextManager.createPersistentContainer (Modules/Sources/WordPressData/Swift/ContextManager.swift):
- A failed step-by-step migration is logged with
DDLogError("Unable to migrate store")and nothing else. Core Data's automatic migration then runs, and if it succeeds nobody is told. - A store that can't be opened at all is backed up and the app crashes with an
NSException. The Sentry event that used to explain why is commented out too. - The Sentry calls were commented out in #24378 (
c062a59ae4) with// FIXME: Import the Sentry stuff, too — But it accesses the app delegate!.SentryStartupEventnow has no callers. CoreDataHelper.restoreStoreCopy(the WordPress → Jetpack data import) runs the migrator withtry?(CoreDataHelper.swift:284), so failures there aren't even logged.
Why it matters
Today a failed step loses nothing, because every migration step is inferred (#24208 removed all custom mappings). But if someone adds a custom mapping, a failed step would silently skip it, which is the data loss described in #13014. Without reporting, we wouldn't know.
Suggested fix
- Give
ContextManagera way to report errors thatWordPressDatacan reach without the app delegate. For example, an error handler the app sets at launch that forwards toCrashLogging, or a swift-log error the app already sends to Sentry. - Report a failed step-by-step migration even when the fallback succeeds, the store-open failure before the crash, and the
try?inrestoreStoreCopy. - Delete
SentryStartupEventif it stays unused.
- 主要言語
- Swift
- スター
- 3.9k
- フォーク
- 1.2k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 136
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wordpress-mobile/WordPress-iOS のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
wordpress-mobile/WordPress-iOS#26423 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Pri] Low [Status] Ready for Dev [Type] Bug /Me
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wordpress-mobile/WordPress-iOS#26279 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Pri] Low [Status] Ready for Dev [Type] Bug Share Extension
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
wordpress-mobile/WordPress-iOS#26276 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Pri] Low [Status] Ready for Dev [Type] Bug Blogging Prompts Notifications
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
wordpress-mobile/WordPress-iOS#26256 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Status] Ready for Dev [Type] Bug Reader
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
wordpress-mobile/WordPress-iOS#26254 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
wordpress-mobile/WordPress-iOS の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
🎉 Add RemoteCrabオープン
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
jaywcjlove/awesome-mac#4999 ·
メンテナーはふだん 1 日以内に返信
-
[Type] Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
wordpress-mobile/GutenbergKit#940 ·
メンテナーはふだん 1 日以内に返信
-
pending-maintainer-response pending-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
aws-amplify/amplify-swift#4423 ·
メンテナーはふだん 2 日以内に返信
-
tests
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
erkamyaman/unslop-anything#80 ·
メンテナーはふだん 1 日以内に返信