Posts deleted locally by a list sync while still in use (umbrella for several crashes)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- 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 日以内に返信