Posts deleted locally by a list sync while still in use (umbrella for several crashes)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start in PostRepository.swift at paginate(...) and the purgeExisting logic; trace how first-page syncs interact with open editors, saves, and in-flight updates. Use the shared repro recipe with Network Link Conditioner, then check any proposed fix against all five linked crashes and the related stale-post bugs.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Several crashes, and a few long-standing bugs, look like the same problem: a Post is deleted from Core Data while some part of the app is still using it, and that code then crashes or writes to it.
Mechanism (hypothesis, from the individual write-ups)
PostRepository.paginate(...)passesdeleteOtherLocalPosts: offset == 0(PostRepository.swift~L506), which becomespurgeExisting(~L667). Every first-page sync of a post list deletes local posts that aren't in that page.- These syncs run often. Breadcrumbs show the main list re-syncing page 1 every few seconds, possibly triggered by
NWPathMonitorreachability updates. - Places that still hold the deleted post then crash:
- an in-flight save or status change (
PostRepository,PostHelper.update) - an editor that's open or being opened (
AztecPostViewController.init,GutenbergSettings.mustUseGutenberg) - a Posts search result row
- While an editor is open, the post list stops observing changes (its fetch delegate is nil), so on-screen rows can point at deleted objects.
- an in-flight save or status change (
Crashes (Jetpack, last 30 days)
| Issue | Sentry | Users (27.3) | Crashes in |
|---|---|---|---|
| #26316 | JETPACK-IOS-1JSW | 78 (7.8× vs 27.2: a real regression) | PostCategory.lookup after a quick status change |
| #26317 | JETPACK-IOS-1BN2, 1CA4 | 51 + 32 | Media.makeMedia(blog:), force-unwrapping blog.managedObjectContext! |
| #26318 | JETPACK-IOS-1KJC | 41 | Blog.xmlrpcApi with post.blog == nil (crashes since #25869, 27.2) |
| #26319 | JETPACK-IOS-1GFE (was 1HPP/1HQY) | 46 | classic editor init precondition |
| #26320 | JETPACK-IOS-1KP9 (was 1JXN) | 13 | GutenbergSettings.mustUseGutenberg |
27.3 has about 4.2× as many users as 27.2 in Sentry, so only 1JSW stands out per user. The others are steady and long-running.
Possibly related bugs: #24138 and #24245 (dashboard cards keep showing stale posts), and #24190 (trashing a stale draft can trash the published post).
Fix directions to evaluate
- Don't purge posts that are in use. Skip posts that have an open editor, a local revision, or an in-flight sync or save when
purgeExistingruns. - Check before using a post held across an
awaitor a callback. Re-fetch byobjectIDwithexistingObject(with:), and bail out ifisDeletedormanagedObjectContext == nil, instead of force-unwrapping. That alone would turn most of these crashes into handled errors. - Narrow the purge, for example only for list filters that are actually being refreshed, not on reachability-driven syncs.
A fix for (1) or (3) should be checked against all five crashes at once.
Shared repro recipe
Jetpack app, a WordPress.com site with more than 20 posts, and Network Link Conditioner set to add 2–3 s of latency.
- Open Posts. From a row's menu, change the status of a post that's near the bottom of the first page.
- While that request is in flight, pull to refresh, or toggle the network, so page 1 re-syncs.
- Variations: open a post in the editor, close it, and reopen it immediately. Open a post from Posts search while the list re-syncs.
Each linked issue has its own Sentry snapshot, breadcrumbs and event IDs.
Generated by Claude Code
- 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