Page MenuHomePhabricator

Allow user to cancel saving articles offline when syncing reading lists
Closed, ResolvedPublic

Assigned To
Authored By
RHo
Oct 5 2017, 4:50 PM
Referenced Files
F14065658: System notifications pane.png
Feb 27 2018, 9:27 PM
F10570778: image.png
Nov 2 2017, 3:06 PM
F10570877: image.png
Nov 2 2017, 3:06 PM
F10570449: image.png
Nov 2 2017, 3:06 PM
F10570447: image.png
Nov 2 2017, 3:06 PM
F10570769: image.png
Nov 2 2017, 3:06 PM
F10570898: image.png
Nov 2 2017, 3:06 PM
F10561214: Fullscreen_11_1_17__6_05_PM.png
Nov 2 2017, 1:21 AM

Description

User story

As a user wishing to conserve data, when syncing reading lists I want to be able to stop downloading articles to my device so that I can just keep the reading lists record without wasting data usage.

Current behavior

When a user syncs their reading lists to their device, the articles are all default automatically being saved for offline.

Proposed solution

Show the progress of saving articles offline as a Notification in the system status bar, and allow the user an explict action to "Cancel" saving articles offline. If the Cancel action is pressed, any remaining pages that haven't yet been saved shall be marked as online-only.

Example downloading articles offline notification:

System notifications pane.png (640×360 px, 36 KB)

Ideally we can show the top-most notification with actions to pause or cancel, else the second notification with just a progress and "tap to cancel" action.

NOTE: Initially we are using the same notification for both the following scenarios, but may change throughout release and testing.
Scenario A. First time a user initializes sync on a new device

When a user logs on to a new device or a second device for the first time, it is likely that there is a large number of articles being queued for download.

Scenario B. Day-to-day syncing behavior

Each time a user logs into the app, if they have added an article to the reading list from web or another device, it will also show a notification as the sync occurs.

QA Steps

A. Environment setup steps
  1. Login and try to make at least two reading lists. In each reading list please contains at least 10 articles, be sure to add a large article (e.g. United State)
  2. Exit the app, and on your Android system, go to Settings -> Apps-> select Wikipedia (the version you are currently testing) -> Clear Data
  3. Relaunch the app, and then you can see the notification bar with downloading processes.
B. Another device setup steps
  1. Login with the same account that you have used on A.
  2. Make sure to complete all the syncing process
Scenario - 1 - Pause & Resume
  1. Follow by the A-3. and stay on the Feed page, and try to click on Pause and then Resume. When articles have been downloaded, go to My Reading List to see the articles' status.
Scenario - 2 - Pause & Resume II
  1. Follow by the A-3. and stay on the Feed page, and try to click on Pause.
  2. When it's pausing, go to My Reading List to see the articles' status. In the meantime, click on the Resume to check whether the syncing process can work correctly.
Scenario - 3 - Pause & Resume III
  1. Follow by the A-3. and stay on the Feed page, and try to click on Pause.
  2. When it's pausing, scroll down the Feed page and add an feature article to a exist reading list.
  3. After adding an article, click on the Resume to check whether the syncing process can work correctly.
Scenario - 4 - Cancel
  1. Follow by the A-3. and stay on the Feed page, and try to click on Cancel.
  2. When the notification bar has been dismissed, go to the My Reading List to see the articles` status. The status of the remaining articles should be in online (the download icon with grey circle)
  3. Try to click on the article which has not been downloaded to see whether the article can be downloaded correctly
Scenario - 5 - Syncing to another device when open the app
  1. Follow by the A-3. and stay on the Feed page.
  2. (Different devices) Follow by the B-2. and try to add 2 ~ 3 articles to the exist reading list.
  3. Back to use the 1. device, try to navigate to either an article or go to the My Reading List to see whether the notification is displayed correctly

Event Timeline

NHarateh_WMF subscribed.

This could be split into 2 tasks:

Task 1 ) First time syncing/syncing large lists
How do we handle the initialization of saving offline?
How do we handle syncing large lists?

Task 2) Day to day sync and storing offline behavior

RHo removed the point value for this task.
Dbrant subscribed.

Note: I've updated the description of this task to say "Notification" (i.e. system status bar popup) instead of "toast". @RHo please amend if this isn't right.

@RHo
If it is possible, please help to provide the texts of the Notification bar and the Notification Channel (Android 8.0). Notifications | Android Developers

Thanks!

  • Notification bar:
    1. Title
    2. Description

Screenshot_20171031-164326.png (1×512 px, 560 KB)

  • Notification Channel:
    1. User-visible name of the channel
    2. User-visible description of the channel.

Screenshot_20171031-164331.png (1×512 px, 903 KB)

hi @cooltey - I've updated the description with a mock. Looks like we are able to implement the second version with the tap to cancel action only?

System notifications pane.png (640×360 px, 27 KB)

@RHo

Thanks for the updated description.

I will try to implement the first one (which I attempted to do) and will let you know if it does not work.

BTW, I am not sure that I can get the estimated time of syncing articles, but I can get how many articles left and do something like X of 100 synced with the percentage.

thanks @cooltey - count of articles with progress % should be sufficient.

@RHo

Seems like since the Android N, the icons beside the action buttons will no longer be displayed. - SOURCE

Fullscreen_11_1_17__6_05_PM.png (1×687 px, 450 KB)

Also if we want show the percentage on the right side of the notification bar, I think we will need a custom view for all the notification items (progress bar, buttons, icons, texts).

Should I keep it simple? or make a custom view to match your mocked example.

Hi @cooltey - from N the icon doesn't display next to the notification, but should be shown as a smaller icon at the top instead next to the name of the app from which the action originates.

If you can do the version with pause and cancel actions, I think it should look like the following:

Eg. Expanded Notification in Android N
image.png (322×844 px, 21 KB)
Pre-N version
image.png (266×722 px, 22 KB)

Else if this is not possible, we can proceed with the 'simpler' version without actions or percentage, can we do the following?

Eg. Notification in Android N
image.png (236×870 px, 18 KB)
Pre-N version
image.png (178×720 px, 17 KB)

This is akin to what Pocket does:

Eg. Pocket notification in Android N
image.png (196×772 px, 31 KB)
Pre-N version
image.png (164×766 px, 54 KB)

Thanks, @RHo. I will try to implement the first version (with buttons) and will let you know if it works.

Added a QA setup steps and some testing scenarios.

Will add more testing scenarios when the patch is ready for testing.

Change 388269 had a related patch set uploaded (by Cooltey; owner: Cooltey):
[apps/android/wikipedia@master] Allow users to cancel/pause/resume the downloading process when syncing - Use BroadcastReceiver to receive the actions from notification bar - For < API19, use regular activity to receive the cancel action from notification bar - When login / syncing,

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

Change 388269 merged by jenkins-bot:
[apps/android/wikipedia@master] Allow users to cancel/pause/resume the downloading process when syncing - Use BroadcastReceiver to receive the actions from notification bar - For < API19, use regular activity to receive the cancel action from notification bar - When login / syncing,

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

ABorbaWMF subscribed.

Tested v2.6.206-alpha-2017-12-04. Looks good on Pixel and Nexus 4.

Scenario 1 - Looks good. Pause and resume are working.
Scenario 2 - Looks good as well.
Scenario 3 - Seems to work just fine. I was able to add articles while syncing.
Scenario 4 - Looks good too, I also tested downloading individual articles and saving whole lists after canceling sync.
Scenario 5 - Syncing between two devices looks good.

I tried a few other things around saving and syncing. All looks good to me.

@Dbrant – does this need to be moved to the G-board for re-testing on the final sync service?