Page MenuHomePhabricator

Fix 5.5 explore feed crashes
Closed, ResolvedPublic

Description

Collection view layout crash:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'no UICollectionViewLayoutAttributes instance for -layoutAttributesForSupplementaryElementOfKind: UICollectionElementKindSectionFooter at path <NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}'

This was a crash we saw before. It was fixed by always adding footer attributes (even if the explore feed section had no footer). The likely cause was a section without a footer being reused as section with a footer and lacking the layout attributes for that footer.

In making the collection view layout reusable for the detail views, I removed the code that always added a header and footer, which re-introduced the crash.

Testing Criteria
Load new content in the explore feed (new feed day, new because you read sections, older sections at the bottom of the feed), and tap through to detail views (News, Top Read, Because you read, Nearby) and ensure the layout looks correct and the app doesn't crash.

Repro Steps

  1. On iPad, iOS 10.3, clean install
  2. Save the featured article
  3. Pull to refresh
  4. Scroll down to the "Enable Location"
  5. Enable location

^ This crashed 100% of the time for me

ImageURL range crash:

- [WMFExploreCollectionViewController imageURLForIndexPath:]
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 3 beyond bounds [0 .. 2]'

^ unable to repro this crash, but the solution is clear. Testing criteria is the same as the above crash.

Event Timeline

JoeWalsh renamed this task from Fix collection view layout crash to Fix top 5.5 crashes.Jun 21 2017, 10:35 AM
JoeWalsh updated the task description. (Show Details)
JoeWalsh updated the task description. (Show Details)
JoeWalsh renamed this task from Fix top 5.5 crashes to Fix 5.5 explore feed crashes.Jun 21 2017, 10:43 AM
JoeWalsh updated the task description. (Show Details)

I was not able to reproduce this when testing on iPhone 6s (iOS 10.3.3) and with Wikipedia app 5.5.1 (1157), but TSG can test again when we arrive home in San Francisco on July 4 if it is not closed yet.

ABorbaWMF subscribed.

Tested on iPhone 7+ with iOS 10.3.2, iPhone 5s with iOS 10.2, and iPad Mini 2 Retina on 10.2.1 on App version 5.5.1 (1162)

Looks good. I tested over a couple days. No crashes.