Closed kurzee closed 4 years ago
I can't reproduce either, but my partial guess at what's going on:
removeDefaultWordPressComAccount
(in the stack)AccountChangedNotification
hasn't been posted yet)BlogListDataSource
gets notified, which calls controllerDidChangeContent
, which clears the cached sections (blogs)BlogDetailsViewController
receives a NSManagedObjectContextObjectsDidChangeNotification
notification, saying the blog that it's showing has been deleted, and it calls popToRootViewController
. This causes the blog list to refresh its cells.My guess is that the problem happens if the second happens before the first, and the blog list tries to redraw cells for deleted blogs, before the data source gets a chance to reload its data.
I'm still not sure why the blog would be nil
and not a faulted object, @astralbodies any ideas?
I think this issue still rarely occurs: https://sentry.io/share/issue/12b4173dfe0b48f58636f1f277403c1d/
I've noticed a crash similar to this when quickly logging out of the simulator (but not a device) after it launches. In the cases I've seen it appeared that the call to sync blogs was finishing after logging out. Basically:
I thought we had a separate issue opened for it but maybe I was just thinking of this one. š¤
I noticed a crash after log out while beta testing 12.8 today (WP Internal 12.8.0.20190701).
Here are some possibly relevant lines from my app logs at the time of the crash. The part about autofill and Safari looks suspicious to me but I am not 100% sure it's related.
2019-07-08 14:25:11:613 Unable to unregister push for Device ID 30842580: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://public-api.wordpress.com/rest/v1.1/devices/30842580/delete?locale=en, NSErrorFailingURLKey=https://public-api.wordpress.com/rest/v1.1/devices/30842580/delete?locale=en, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <AC36D6F2-6C08-47B4-8205-59A7F07336E0>.<89>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <AC36D6F2-6C08-47B4-8205-59A7F07336E0>.<89>, NSLocalizedDescription=cancelled}
2019-07-08 14:25:11:633 Could not sync sites: Optional(Error Domain=WordPressKit.WordPressComRestApiError Code=2 "An active access token must be used to query information about the current user." UserInfo={WordPressComRestApiErrorMessageKey=An active access token must be used to query information about the current user., NSLocalizedDescription=An active access token must be used to query information about the current user., WordPressComRestApiErrorCodeKey=authorization_required})
2019-07-08 14:25:19:805 Completed requesting shared web credentials
2019-07-08 14:25:19:805 Error requesting shared web credentials: Optional("The operation couldnāt be completed. (OSStatus error -909 - Autofill is not enabled in Safari settings)")
2019-07-08 14:25:31:334 <WordPress.WordPressAppDelegate: 0x280aff980> applicationWillResignActive(_:)
2019-07-08 14:25:33:373 <WordPress.WordPressAppDelegate: 0x280aff980> applicationDidBecomeActive(_:)
2019-07-08 14:25:44:147 <WordPress.WordPressAppDelegate: 0x280aff980> applicationWillResignActive(_:)
2019-07-08 14:25:44:902 <WordPress.WordPressAppDelegate: 0x280aff980> applicationDidEnterBackground(_:)
2019-07-08 14:26:02:678 <WordPress.WordPressAppDelegate: 0x280aff980> applicationWillEnterForeground(_:)
2019-07-08 14:26:02:697 App launched with authentication link
2019-07-08 14:26:03:056 Error while retrieving WordPressComOAuthKeychainServiceName token: Error Domain=SFHFKeychainUtilsErrorDomain Code=-2000 "(null)"
2019-07-08 14:26:03:056 Error while deleting WordPressComOAuthKeychainServiceName token: Error Domain=SFHFKeychainUtilsErrorDomain Code=-2000 "(null)"
2019-07-08 14:26:03:058 Error while deleting WordPressComOAuthKeychainServiceName token: Error Domain=SFHFKeychainUtilsErrorDomain Code=-25300 "(null)"
Tested with WP Internal 12.8.0.20190701 on iPhone 6S iOS 12.3.1.
I tried replicating this crash using the following steps:
Result: no crash and the log out step always worked normally for me.
Tested with WPiOS 14.4 App Store version and WP Internal 14.5.0.20200323 on iPhone 11 iOS 13.3.1.
fwiw, the only result that comes up in Sentry in a search for BlogListDataSource
returned a crash which was recorded 4 times total for 2 different users in the past 90 days. I can't quite tell if it's the same crash though. See https://sentry.io/share/issue/d6934099caaa4eedb3cb80a07ff6771b/.
Because a lot has changed in the app since this was first filedāincluding the tool we are using to track crash reportsāand because I have been unable to replicate the crash in testing, I would like to close this issue and either re-open it if a new case comes up or let a new issue get created and track it in a new issue from that point on.
@koke there is a crash that randomly occurred to both me and @SergioEstevao while at our meetup here in Amsterdam. We've been unable to reproduce, but the stack points to
BlogListDataSource.swift
. I'm at a loss here for nailing this down, but perhaps you'll know a bit more.To produce, each of us did the following:
The crash in the
7.6
internal build, and in Fabric as#33
is:I also believe the source of this to similarly produce a
7.5
crash, in Fabric as#24610
:Scratching my head here points to a nil blog at: https://github.com/wordpress-mobile/WordPress-iOS/blob/develop/WordPress/Classes/ViewRelated/Blog/BlogListDataSource.swift#L293
@koke any ideas how a nil blog could be produced here if a blog were deleted (i.e. logged out)?
cc @aerych, @nheagy I'll create a separate issue for the NUX bug, which cannot be recovered from after force-quitting the app, only after reinstalling. š¬
cc @astralbodies this would be an unrecoverable crash in
7.6
or earlier, given above.