Report Core Data migration failures to Sentry
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- ios, swift
- Ambito
- mobile, observability
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Swift
- Stelle
- 3.9k
- Fork
- 1.2k
- Merge medio
- 1g 23h
- PR unite (30g)
- 136
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di wordpress-mobile/WordPress-iOS
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
wordpress-mobile/WordPress-iOS#26423 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Pri] Low [Status] Ready for Dev [Type] Bug /Me
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
wordpress-mobile/WordPress-iOS#26279 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Pri] Low [Status] Ready for Dev [Type] Bug Share Extension
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
wordpress-mobile/WordPress-iOS#26276 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Pri] Low [Status] Ready for Dev [Type] Bug Blogging Prompts Notifications
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
wordpress-mobile/WordPress-iOS#26256 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Status] Ready for Dev [Type] Bug Reader
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
wordpress-mobile/WordPress-iOS#26254 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di wordpress-mobile/WordPress-iOS
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
🎉 Add RemoteCrabAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
jaywcjlove/awesome-mac#4999 ·
I maintainer di solito rispondono entro 1 giorno
-
[Type] Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
wordpress-mobile/GutenbergKit#940 ·
I maintainer di solito rispondono entro 1 giorno
-
pending-maintainer-response pending-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
aws-amplify/amplify-swift#4423 ·
I maintainer di solito rispondono entro 2 giorni
-
tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
erkamyaman/unslop-anything#80 ·
I maintainer di solito rispondono entro 1 giorno