Page MenuHomePhabricator

[Feeds] Persist the state of dismissed cards.
Closed, ResolvedPublic3 Estimated Story Points

Description

This is to implement the mechanism for persisting the state of cards that were dismissed by the user from the Feed list, so that they remain dismissed when the feed is refreshed or the app is restarted.

Some discussion notes:

One way to implement this might be to persist the List<Card> in FeedCoordinatorBase as a JSON string SharedPreference, like we do for page tabs, in onPause and restore them in onResume(). Some considerations:

  • Dismissed Cards are marked "dismissed" and preserved like any other Card.
  • Cards flagged with dismissed are not replaced when updating the list.
  • Cards flagged with dismissed do are not considered for display.
  • The List size would be capped at 500(?) Cards.

The complication is in handling subsequent updates to the List. Consider the following scenarios in testing:

  • The first Card of the List is dismissed yesterday and an update is requested.
  • The last Card of the List is dismissed and an update is requested.
  • All cards for a given date have been dismissed and an update for that date has been requested. (Don't show dismissed cards and don't make redundant requests.)
  • The List has exceeded the maximum allowed size by growing upward. (Some cards must be sticky like search.)
  • The List has exceeded the maximum allowed size by growing downward. (Some cards must be sticky like search.)
  • The List is empty.
  • The List only contains dismissed Cards. (Request more Cards and don't show dismissed Cards.)
  • A force refresh has been requested. (Don't show dismissed Cards.)

The above was only suggested as it seems lower cost than a database solution.

Related Objects

Event Timeline

Change 304037 had a related patch set uploaded (by Dbrant):
Persist state of dismissed feed cards.

https://gerrit.wikimedia.org/r/304037

Dbrant set the point value for this task to 3.
Dbrant added a project: Unplanned-Sprint-Work.
Dbrant moved this task from To Do to Code Review on the Mobile-App-Android-Sprint-88-Radium board.

Change 304037 merged by jenkins-bot:
Persist state of dismissed feed cards.

https://gerrit.wikimedia.org/r/304037

for QA:

  • While looking at the Explore feed, dismiss the top two cards (i.e. News, Featured article)
  • Exit the app by pressing Back
  • Launch the app again, and verify that the cards you dismissed are still dismissed (do not reappear)

Testing on Wikipedia app 2.3.150-alpha-2016-08-16 and Android 6.0.1 Samsung-SM-J120A mobile phone. After recreating the @Dbrant steps above the cards I dismissed do not reappear so this is fixed.