Page MenuHomePhabricator

Activity Tab: Clean up Saved Articles Data
Open, LowPublic5 Estimated Story Points

Description

Fetch Data. The goal here is to clean things up so that we don't have to pass in saved data fetching closures from the coordinator. The WMFData ActivityTabDataController should be able to fetch saved article data internally.

  • Cleanup:
    • Bump Wikipedia.xcdatamodel, add isSavedMigrated boolean to WMFArticle
    • Bump WMFData.xcdatamodel, add savedDate to WMFPage (or create a new entity with saved metadata and create a 1-to-1 relationship with WMFPage).
    • Create an operation class that regularly fetches WMFArticle items that have isSavedMigrated = false, for each item, copy over the savedDate to WMFData object. Mark isSavedMigrated = true when done.
    • Whenever old legacy saves an article, go ahead and keep it adding a "savedDate" in WMFArticle, but in the same spots also update the WMFData fields.
  • Fetch new data:
    • Activity tab saved articles module should only fetch saved information from WMFData (consider creating a shared SavedArticleDataController to pull this, in the future we will reference this data controller for everything related to saved articles).
    • For getting article summaries (I.e. the image for the saved article module circles)...just try fetching the image from existing WMFArticleSummaryDataController. There's no built-in summary cache like the old legacy code, but I think the network stack will already be able to cache this internally fairly well. Let's see how it acts naturally without extra caching for now.

QA Notes

This task cleans up some of our saved articles data logic for the Activity Tab module. Regression-test the saved articles module from T408587 and regression-test Saved articles in general. Update from a previous app version and ensure saved articles are not lost.

Test Steps

Note: testing might take a while because we need to test syncing two devices, and sync time is 3h

Install an older build, make sure you have saved articles from this month
Install this version.
Make sure you see your saved articles and images in activity tab for this month.
Save an article. Make sure the saved date updates and images are fetched correctly.
Unsave the last article. Make sure the last saved date updates.
In Settings, erase all articles. Verify the view updates.
Log in to another device and add articles - make sure saved articles are displayed correctly in the activity tab (you might want to tweak AppDelegate.backgroundFetchInterval to make the background sync shorter)

Log in to 2 separate devices with the same account, with sync on
Note: currently sync interval is 3h
In one device, save an article.
When saving an article on a device, verify that the number of articles is updated as soon as you enter the activity tab.
In one device, delete one or all articles. Article count is correct in the other articles after sync time.

Stress testing:

Go to settings -> Database population
Add a large number of articles (that might take a while). When done, the spinner will disappear.
Check current saved articles, check the activity tab. Make sure it works.
Check syncing two devices with 1000 articles

Event Timeline

Tsevener triaged this task as Medium priority.Oct 28 2025, 4:13 PM
Tsevener updated the task description. (Show Details)
Tsevener renamed this task from Activity Tab (Eng Subtask): Articles saved module - Data to Activity Tab (Eng Subtask): Clean up Saved Articles Data.Fri, Nov 7, 2:14 PM
Tsevener renamed this task from Activity Tab (Eng Subtask): Clean up Saved Articles Data to Activity Tab: Clean up Saved Articles Data.
Tsevener updated the task description. (Show Details)
HNordeenWMF lowered the priority of this task from Medium to Low.Tue, Nov 18, 6:09 PM

Hey @Mazevedo, checking in on this task as it has been on the board for 2 sprints so far.
How many remaining points are there?

@HNordeenWMF I think we underestimated this one. I'd say two morepoints

ABorbaWMF subscribed.

Working for me on 7.8.7 (5896). Tested on iPhone 16 on iOS 26, iPad Pro on iPadOS 26, and iPhone 11 on iOS 18.