Implement fetcher for getting "article preview" data
Closed, ResolvedPublic3 Story Points

Description

The goal of this ticket is to implement a client which sends a lightweight API request to power the native article view w/o having to make the full mobileview request.

Acceptance Criteria

  • "Fetcher" API accepts a title, returns a promise which resolves to a model object for article "preview" (name not final)
  • "Preview" object contains: description, lead image (i.e. "thumb" at lead image resolution), first section HTML, and TOC
  • Business logic for using cached mobileview response and falling back to preview API request is implemented

Business Logic

Given I am on the native article view
When the mobileview response is cached
Then the mobileview response data is displayed in the native article view

Given I am on the native article view
When the mobileview response is not cached
Then I will get data for the native article view using a lightweight MW API query

Fjalapeno updated the task description. (Show Details)
Fjalapeno raised the priority of this task from to Needs Triage.
Fjalapeno moved this task to Needs Estimation on the Wikipedia-iOS-App-Backlog board.
Fjalapeno added a subscriber: Fjalapeno.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 10 2015, 6:52 PM
Mhurd added a subscriber: Mhurd.Jul 10 2015, 6:56 PM

Note: the android app (and old versions of the iOS app) have the exact query params we need to fetch only the lead section html (w the complete list of toc section titles)

Mhurd added a comment.Jul 10 2015, 6:59 PM

The goal of this is to be able to have the native cards only request exactly what they need for display - i.e. all TOC section titles, but ONLY the first section HTML

Mhurd added a comment.Jul 10 2015, 7:09 PM

Old params (may need tweaking as we've adding other params in the mean time):

NSMutableDictionary *params =
@{
  @"action": @"mobileview",
  @"prop": @"sections|text|lastmodified|lastmodifiedby|languagecount|id|protection|editable",
  @"sectionprop": @"toclevel|line|anchor|level|number|fromtitle|index",
  @"noheadings": @"true",
  @"page": title,
  @"format": @"json"
  }.mutableCopy;

if (!leadSectionOnly) {
    params[@"onlyrequestedsections"] = @"1";
    params[@"sections"] = @"1-";
}else{

    //Reminder: do not set @"onlyrequestedsections": @"1" for lead section.
    //Need to see keys for the subsequent sections so the "needsRefresh"
    //value can be left YES until subsequent sections have been retrieved
    //(if there's more than a single section).

    params[@"sections"] = @"0";
}
Fjalapeno assigned this task to Mhurd.Jul 14 2015, 11:14 PM
Fjalapeno set Security to None.
Fjalapeno edited a custom field.
Mhurd updated the task description. (Show Details)Jul 14 2015, 11:15 PM

@Fjalapeno @Mhurd I'm not sure this is feasible since we (unfortunately) need the page HTML to determine the in-order list of images to show in the gallery. Hopefully this will be moved to a server-side, cacheable API call in the near future.

BGerstle-WMF renamed this task from Create minimal fetch for native card population (not all HTML) to Implement fetcher for getting "article preview" data.Jul 15 2015, 4:52 PM
BGerstle-WMF updated the task description. (Show Details)

@Fjalapeno @Mhurd updated ticket description w/ more details from our discussion. Mobileview will be fetched lazily to display image gallery (or full page content in webview)

Mhurd reassigned this task from Mhurd to Fjalapeno.Jul 27 2015, 9:05 PM
MBinder_WMF closed this task as Resolved.Oct 7 2015, 10:07 PM