Page MenuHomePhabricator

Build talk page controller layer
Closed, ResolvedPublic

Description

This layer will be the interface to calls from the Talk Page View Model to the API fetcher methods created in https://phabricator.wikimedia.org/T311071. It will:

Combine multiple calls to populate initial screen (header, topics & threads, revision ID):
Have an initial data fetching method that call 3 API calls in parallel and combine the results:

  • The initial discussion tools API endpoint to get the topics and thread items.
  • An article summary call to get the header image and article discussion string
  • A call to get the latest revision ID to use in the permanent link overflow menu item url.

Return data while offline:
As a follow on PR, we will need to persist the discussion tools API endpoint response to the file system, and return that persisted response in case of an offline error. Article summaries should already set up to persist / fetch from persistence in the app. Revision ID persistence TBD.

Misc
Other API calls (topic subscription read / write, posting new topic or reply, etc) will just be passthrough methods and not wrap any additional logic until needed.

Event Timeline

LGoto triaged this task as High priority.Aug 16 2022, 6:35 PM

Part 1 PR for populating the header data (minus project icon) - https://github.com/wikimedia/wikipedia-ios/pull/4291

Project icon handling will be in a follow up PR. It's complete and currently in the talk-pages-controller-header-all branch, but it could use more testing.

Tsevener moved this task from Doing to Needs Code Review on the ios-app-v7.0 board.

Things remaining to develop:

  • Basic persistent caching of talk page items endpoint for offline mode
  • Make parallel call to fetch latest talk page revision ID, to use in constructing one of the overflow menu links.
Tsevener added a subscriber: Mazevedo.

Moving to PM signoff - QA will test this functionality as a part of the other feature tasks.

JMinor claimed this task.