Page MenuHomePhabricator

Reading list pages remain in save cache after deletion
Closed, ResolvedPublic1 Estimated Story Points

Description

Steps to reproduce

  1. Clear all app data
  2. Save a page to a reading list
  3. Go offline
  4. Delete the reading list
  5. Clear the cache
  6. Reload the page

Expected results

Page offline error message appears

Actual results

Page is loaded

Environments observed

App version: master
Android OS versions: 4.4 Kitkat (CM 11), 7.1.2 Nougat
Device model: Samsung Galaxy SIII, Nexus 6P
Device language: en

Event Timeline

Mholloway renamed this task from Regression: Un-saving a page has no effect; it remains stored on disk to Regression: Un-saving a page has no apparent effect; it remains stored on disk and available for loading.May 5 2017, 5:14 PM

Change 352859 had a related patch set uploaded (by Dbrant; owner: Dbrant):
[apps/android/wikipedia@master] Trigger saving/unsaving of page upon toggle.

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

Change 352859 merged by jenkins-bot:
[apps/android/wikipedia@master] Trigger saving/unsaving of page upon toggle.

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

Tested on Nexus 4 with Android 5.1 and Pixel with Android 7.1 on 2.5.195-alpha-2017-06-05
I am having some issues reproducing the scenario above. Here is what I tried:

Installed the app

  1. Searched for an article and opened it (example Tabasco Sauce)
  2. Tapped save and added the article to a reading list
  3. Tapped on a link within the article (Avery Island)
  4. Tapped save and added the second article to the same reading list
  5. Went to saved articles and turned off offline availability
  6. Cleared app history
  7. Closed all open article tabs
  8. Closed the Wikipedia app completely
  9. Placed device in airplane mode
  10. Reopened the app and tapped on the saved articles

In this case, The article opens normally, but it seems like they should not. @Dbrant, do these steps make sense?

Yep, confirmed it's still broken per the instructions from @ABorbaWMF, at least according to my understanding of how the caches are intended to work. Removing from offline should blow away any trace of the article from storage.

Well, hang on now:
Even if you remove a page from offline availability, it may still be present in the main OkHttp cache (as opposed to the saved-page cache), and would therefore still be accessible offline. I think an additional step for testing this would need to be:

  • 8.5: Go to system app settings, and clear the Cache of the Wikipedia app.

It used to be that the page was cleared from both caches. Maybe this has changed? The article remaining in HTTP cache is arguably what should happen, just not what's intended to happen, as best I can recall from last time we all discussed it.

Looking at SavedPageSyncService, though, it's only touching the SAVE_CACHE, so this could be working as intended after all.

Indeed; and I think that's actually how it should be -- allow OkHttp to manage its primary cache the way it wants, and only apply our custom logic to our own custom cache.

While working on T166596 I confirmed in the debugger that pages are indeed remaining in the save cache.

Repro steps:

  1. Clear all app data
  2. Save a page to a reading list
  3. Go offline
  4. Delete the reading list
  5. Clear the cache
  6. Reload the page

The page should no longer be present, but it's still there; and I confirmed from debugging CacheDelegateInterceptor that it's coming from the save cache.

Change 378338 had a related patch set uploaded (by Mholloway; owner: Mholloway):
[apps/android/wikipedia@master] Fix: Clear deleted offline pages from the save cache

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

Mholloway renamed this task from Regression: Un-saving a page has no apparent effect; it remains stored on disk and available for loading to Reading list pages remain in save cache after deletion.Sep 15 2017, 9:09 PM
Mholloway updated the task description. (Show Details)
Mholloway updated the task description. (Show Details)
Mholloway updated the task description. (Show Details)

Change 378715 had a related patch set uploaded (by Dbrant; owner: Dbrant):
[apps/android/wikipedia@master] Fix: make sure page contents are deleted from disk when deleting from list.

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

Change 378338 abandoned by Mholloway:
Fix: Clear deleted offline pages from the save cache

Reason:
see Iba7004

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

Change 378715 merged by jenkins-bot:
[apps/android/wikipedia@master] Fix: make sure page contents are deleted from disk when deleting from list.

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

Tested on a Nexus 4 with Android 5.1 and a Pixel with Android 7.1.1 on 2.6.203-alpha-2017-09-18

Looked at it again and confirmed. Ready for sign-off