"index 0 beyond bounds for empty array" crash
Closed, ResolvedPublic

Description

Repro steps:
-fresh install of app.
-search for "food"
-tap on food results
-tap on home icon
-select first nearby results
-scroll down to TOC part of native card for that nearby results
-crash

Mhurd created this task.Aug 26 2015, 7:29 PM
Mhurd updated the task description. (Show Details)
Mhurd raised the priority of this task from to Needs Triage.
Mhurd added a subscriber: Mhurd.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 26 2015, 7:29 PM
BGerstle-WMF set Security to None.

So, this is really interesting.... the bug comes down to the following:

TL;DR; we were caching articles when we probably shouldn't have been, and it was causing weird side effects.

  • Do something that calls articleWithTitle:, thus creating an "empty" article and putting it in our memory cache
  • Go to view that full article, which fetches preview data (again, gets injected with the same data) and sets it on the VC
    • At this point our VC has an article with some data in it
  • Mobile view data comes back, we try to set article again, but it's a no-op because it's the same object. We call importMobileViewJSON: on the same article since the fetcher was fabricating articles with articleWithTitle: and as a result, getting cached objects.
  • Since our attempt to set the "full" data was a no-op, the user scrolls the table only to find the data has changed underneath them, causing the exception discovered by @KHammerstein & @Mhurd.

That's the best description I can give atm, can elaborate more tomorrow.

MBinder_WMF closed this task as Resolved.Oct 7 2015, 10:07 PM