Posts deleted locally by a list sync while still in use (umbrella for several crashes)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Swift
- Star
- 3.9k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 136
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wordpress-mobile/WordPress-iOS
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
wordpress-mobile/WordPress-iOS#26423 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Pri] Low [Status] Ready for Dev [Type] Bug /Me
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wordpress-mobile/WordPress-iOS#26279 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Pri] Low [Status] Ready for Dev [Type] Bug Share Extension
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
wordpress-mobile/WordPress-iOS#26276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Pri] Low [Status] Ready for Dev [Type] Bug Blogging Prompts Notifications
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
wordpress-mobile/WordPress-iOS#26256 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Status] Ready for Dev [Type] Bug Reader
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
wordpress-mobile/WordPress-iOS#26254 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wordpress-mobile/WordPress-iOS
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
🎉 Add RemoteCrabĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
jaywcjlove/awesome-mac#4999 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Type] Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
wordpress-mobile/GutenbergKit#940 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pending-maintainer-response pending-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws-amplify/amplify-swift#4423 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
erkamyaman/unslop-anything#80 ·
Maintainer thường phản hồi trong vòng 1 ngày