wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.69k stars 1.12k forks source link

Editor: Errors editing a failed post #3070

Closed aerych closed 6 months ago

aerych commented 9 years ago

When tapping to edit a post in a failed state, the following was logged to the console:

2015-01-22 13:56:33.772 WordPress[9874:95142] *\ Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UITableView.m:1582 2015-01-22 13:56:43.021 WordPress[9874:95142] CoreData: error: Serious application error. An exception was caught from the delegate of NSFetchedResultsController during a call to -controllerDidChangeContent:. Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out). with userInfo (null) 2015-01-22 13:56:44:259 WordPress[9874:607] !!! Attempted to create a revision of a revision

I think the last line, Attempted to create a revision of a revision maybe is the root issue?

cc @bummytime

UPDATE 06/2020: Attempted to create a revision of a revision HAS BEEN UPDATED TO Post is already a revision, no need to create a new one and still appears when updating a post failed to upload

aerych commented 9 years ago

Following up: there was something weird with the state of the post list when this happened. There was a section for a failed post, then another section containing two different failed posts, and finally the section for published posts.

I'm also seeing the Attempted to create a revision of a revision when creating new posts.

bummytime commented 9 years ago

/cc @diegoreymendez

rachelmcr commented 8 years ago

I haven't been able to reproduce this exact issue (with the weird state of the post list and the first couple lines in the logs above).

I do see the line Attempted to create a revision of a revision when editing a failed post, or when starting a new post on a site that isn't syncing properly, so that's an issue but may not be directly related to the other errors described here.

diegoreymendez commented 8 years ago

The Attempted to create a revision of a revision message is appearing because we have some faulty logic somewhere. It's not dangerous per-se, as the code is smart enough not to create the second revision, but it is an alert due to faulty logic.

The reason is that revisions shouldn't be allowed to live outside of the editor. When it closes, the revision should die with it.

Edit: a crash being the only reasonable cause for a revision to exist outside of the editor. At least the only one I can think of.

diegoreymendez commented 8 years ago

@rachelmcr - Any recent reports resembling this issue? I haven't seen a crash like this in a while now and was wondering if we can close this one for the time being.

rachelmcr commented 8 years ago

The message Attempted to create a revision of a revision is still coming up in app logs in some support issues, but mainly I have seen that around issues where there is a syncing problem (e.g. the oAuth token is expired and the posts aren't syncing). I haven't seen any recent reports where it was related to a failed post, or where it included the assertion failure from the original report here.

nheagy commented 6 years ago

18 months later… has anything changed here? Perhaps Aztec has improved things?

diegoreymendez commented 6 years ago

@nheagy - This isn't really Aztec related. This seems to be an issue with the post list / post synchronization code.

It is still important, though.

jkmassel commented 4 years ago

A user has reported experiencing this issue (and I've confirmed it via the app logs) as of October 2020.

kean commented 6 months ago

You can now open failed posts and posts in the middle of the sync process. Implemented in the scope of pcdRpT-6vS-p2.