Page MenuHomePhabricator

As a user I want my feed content pushed to the feed with all content visible and without changing my scroll position
Closed, ResolvedPublic10 Estimated Story Points

Description

Before implementing notifications we should complete this task.

This ticket will accomplish:

  1. Move the feed to a push model
  2. Make the feed stable as it loads new content
  3. Ensure content is downloaded before it is displayed
  4. Give power to the user to refresh the feed
  5. Allows the feed to easily scale to new types data
  6. Allows the feed to send local push notifications
  7. Allows the feed to migrate to using real push notifications when implemented server side

Along with this, we should implement T138039 too ensure we use too much data since we will be preemptively downloading data.

To implement:

  1. Create a "Feed Source" for each type of item (feature article, nearby, etc).

A feed source should be a combination of the non-UI logic of section controllers + the business logic of the section schema
Should fetch new data and persist it
Should poll its data periodically and should have a setting to control its frequency
Should use a lower QoS for background fetching
Should use background APIs to download data at an interval when the app is backgrounded
Should emit an event/delegate call when new data is available
Should have similar methods from the section controllers
Feed sources will also be responsible for issuing local push notification
Specifically we should create a feed source that asks for the user location permission

  1. Refactor the feed section schema to be just a "feed"

This class should responsible fetching feed items from disk and maintain the in memory list
It should update its list when it gets a notification from a feed source
It should retain feed sources
It should manage the business logic for feed sources (do we need the location feed source?)

  1. Feed VC

The feed VC will create cells for each model object
It owns the feed
It will enable disable the feed and force loads based on the app status and user input

Related Objects

Event Timeline

JMinor subscribed.

I actually think feed refreshing and lazy loading is the most jankety part of our current experience, in addition to the many benefits you list, so am rating it a high priority.

I would like to estimate this sooner than later, and consider adding to Saturn.

Initial acceptance criteria:

  • As a user I should see content in the feed load in place (ie. a card with placeholder should not move as images and text are loaded)
  • Only the user, and not a layout redraw or content update, should change the scroll position of the feed
  • When new content is available "above" my position, it should not be loaded into the feed until I choose to refresh. I should be able to see that new content is available.
  • I should not see the same card load multiple times, even if I scroll the feed or background/foreground the app

To test:

  1. Open the app
  2. Verify that the feed is loaded with 2 days of data
  3. Scroll the list and verify that all data is loaded (except for images)
  4. Verify images are downloaded as you scroll
  5. Tap a card in each section
  6. Verify that all card taps work as expected
  7. Tap a footer in each section
  8. Verify all footers work as expected

Testing on iPhone (iOS 9.3.2) and Wikipedia app 5.3.0 (960). All 2 days of data (10/16 to 10/18) is loaded, images download perfectly, and all card taps and footer taps are working normally, this is fixed.

This is a huge improvement in user experience and responsiveness. Great work.