Page MenuHomePhabricator

[BUG] User should not be able to download a compilation twice
Closed, DuplicatePublic

Description

Originally reported by @Kaartic on IRC

NOTE: This appears to occur on slower network connections, so would be great if QA can try to repro under similar conditions.

Steps to reproduce

  1. Navigate to the details screen for an article pack available in the Offline Library (aka Offline Compilations)
  2. Tap on the Download button to start downloading that article pack
  3. Immediately tap on the Download button again

Expected

On step 3, this should not be possible since the download button should either be disabled whilst the download activity starts, or it should have already started and the download button will have been replaced with the in-progress download controls.

Actual

The download button registers the second tap, and the same article pack is downloaded twice.

=== Occurring on
Wikipedia v2.6.201-alpha-2017-08-23

Event Timeline

I was misspoken a little in the IRC. It doesn't happen on slower network conditions but when trying to download the compilation while offline. The actual steps to reproduce this,

  1. Go offline
  2. Navigate to the details screen for an article pack available in the Offline Library (aka Offline Compilations)
  3. Tap on the Download button
  4. Tap the Download button again (even though it's faded)

As a consequence, the compilation is queued twice for download and gets downloaded twice when the user gets back online.

I guess this shouldn't be possible when compilations reaches productions as I guess the list of article packs would be loaded dynamically. In which case they wouldn't be displayed when a user is offline, I hope! So, I guess this task is invalid. If not, then this is a BUG.

If contradicting my assumptions it is possible for the above steps to happen, then here are a few screens shots of weird behaviour as a consequence of the steps I specified in my comments,

Screenshot_2017-08-24-12-02-20.png (1×720 px, 106 KB)

Screenshot_2017-08-24-12-02-38.png (1×720 px, 68 KB)

After I cancelled one of the downloads

Screenshot_2017-08-24-12-02-54.png (1×720 px, 103 KB)

BTW, it seems that the app currently updates the size the compilations would occupy . Shouldn't it actually update the size after the download gets completed i.e., the size the compilations have occupied?

Hi @Kaartic - thanks for updating the bug report with more details. I think this ticket T172881 covers the same bug whereby once a user 'queues' a pack for download when offline, the download button should no longer appear, but please re-open this if I'm missing some nuance.

I just filed a ticket for the storage display behavior you noted at T174162

Just to be sure, my assumption that "the page with the list of compilations wouldn't be shown in production" is false i.e., it's gonna be shown even while a user is offline.

Hi @Kaartic - thanks for updating the bug report with more details. I think this ticket T172881 covers the same bug whereby once a user 'queues' a pack for download when offline, the download button should *no longer appear*, but please re-open this if I'm missing some nuance.

If the part that I emphasised holds out to be true after T172881 gets resolved then there's no nuance. Currently, when I tap the download button while the device is offline it gets greyed out. When I tap it again it queues the compilation for download for the second time.

I was misspoken a little in the IRC. It doesn't happen on slower network conditions but when trying to download the compilation while offline. The actual steps to reproduce this,

I guess I have to take that back. It seems I wasn't misspoken at least for devices running older versions of android. See T174367