Crash opening the classic editor for a post that was just deleted (precondition in AztecPostViewController.init)

オープン
#26,319 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
ios, swift
領域
mobile-dev

調査の方向性

Start with EditPostViewController.swift and AztecPostViewController.swift, then trace the candidate flow through PostListEditorPresenter and PostRepository.paginate. Build the Jetpack scheme and try the repro steps with a site containing more than 40 posts. Done means reporting whether you reproduced a deleted post reaching the editor precondition and, if so, what cause or fix approach you found.

索引モデルが issue の本文から書いたものです。

説明

[Status] Needs Plan [Status] Needs Repro [Type] Crash Core Data Posting/Editing

Likely shares a root cause with #26316, #26317, #26318, #26320. See #26323: posts are deleted locally by a first-page list sync while still in use.

Sentry: JETPACK-IOS-1GFE

Not actually new in 27.3. On 27.3 these events land in JETPACK-IOS-1GFE, but the same crash (same title, culprit and stack) was grouped as JETPACK-IOS-1HPP and JETPACK-IOS-1HQY on 26.9 to 27.2. Sentry regrouped it on 27.3, possibly because 27.3 was the first build made with Xcode 27 (#26018); that's unconfirmed. The 27.2→27.3 window has no editor or post-list change that explains it.

Sentry snapshot (as of Oct 30, 2026)

Users by release (all three groups, last 90 days): 27.3: 46 · 27.2: 43 · 27.1: 42 · 27.0: 10 · 26.9: 4. 27.3 has about 4.2× as many users reporting any error as 27.2, so per user this is lower on 27.3, not a regression.

Devices: mostly recent iPhones (iPhone 14 to 17 Pro), plus a few iPads. iOS 26.5 to 27.2. App in the foreground.

Stack (fatal, EXC_BREAKPOINT):
EditPostViewController.viewDidAppear → showEditor() (EditPostViewController.swift:128) → EditorFactory.instantiateEditor (EditorFactory.swift:23) → AztecPostViewController.init (AztecPostViewController.swift:450) → precondition(post.managedObjectContext != nil).
The post handed to the editor has already been deleted from Core Data.

Breadcrumb patterns (3 events read)

  • 3 of 3: the user closes an editor (closeWasPressed, sometimes with the discard/save alert) while a POST …/posts/…?context=edit save is still in flight, then opens an editor again within ~1–2 seconds. The new EditPostViewController crashes as it appears.
  • 2 of 3: the Posts list (Drafts tab) is open and its first page re-syncs (status=draft,pending&offset=0) repeatedly while the editor is up.
  • 1 of 3: iPad split view.

Candidate code (hypotheses, not confirmed)

  1. Stale rows while an editor is open. PostListEditorPresenter.openEditor posts .postListEditorPresenterWillShowEditor, and AbstractPostListViewController responds by setting fetchResultsController.delegate = nil until the editor closes. Meanwhile, a first-page sync (PostRepository.paginate with offset == 0 → deleteOtherLocalPosts: true → PostHelper.merge(purgeExisting:)), or the post save itself, can delete a Post that a visible row still references. Tapping that row right after closing passes the deleted object to EditPostViewController.
  2. No guard. Neither PostListEditorPresenter.handle nor EditPostViewController.showEditor checks post.managedObjectContext == nil || post.isDeleted before building the editor.
  • Same root cause as the new mustUseGutenberg crash issue, which shows the same symptom through a different code path. The two could be fixed together.

Repro to try

  1. Use a site with more than 40 posts, so the first page doesn't hold everything. Open My Site › Posts.
  2. Open a post that will use the classic editor (content with no <!-- wp: blocks), make an edit, then close and save.
  3. Immediately, within a second, tap the same post (or one just below it) again.
  4. In parallel, change or trash posts from the web so the next first-page sync purges something. Toggle the network to trigger networkStatusDidChange → automaticallySyncIfAppropriate.
  5. Set a breakpoint on AztecPostViewController.init and check post.isDeleted / post.managedObjectContext.

Pass: the precondition hits, or you can show a row whose post.managedObjectContext is nil.

Representative events

  • de586a8fa25c4e4d8b1827419669bbd1
  • 24365c1b9f13436780e6e8eacffc4d21
  • 42b1534daaa749fb9f20dfc8e8c12e9b (iPad, split view)
  • 70393420835f4750966abde0e6d390fd

Build the Jetpack scheme and sign in using docs/simulator-sign-in.md, with bundle ID com.automattic.jetpack.

When you're done: post the results here. If you now have reliable steps, remove [Status] Needs Repro. If you found the cause and a fix approach, remove [Status] Needs Plan and add [Status] Ready for Dev. Remove Simulator Testable when you're finished.


Generated by Claude Code

主要言語
Swift
スター
3.9k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
136

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

wordpress-mobile/WordPress-iOS のほかの issue

wordpress-mobile/WordPress-iOS の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。