[Offline Storage] Some aborted/interrupted downloads continue to download #6311
Labels
component: offline
The issue involves the offline storage system of Shaka Player
priority: P2
Smaller impact or easy workaround
type: bug
Something isn't working correctly
Milestone
Have you read the FAQ and checked for duplicate open issues?
Yes
If the problem is related to FairPlay, have you read the tutorial?
N/A
What version of Shaka Player are you using?
Latest version 4.7.11
Can you reproduce the issue with our latest release version?
Yes
Can you reproduce the issue with the latest code from
main
?Yes
Are you using the demo app or your own custom app?
Own custom app.
If custom app, can you reproduce the issue using our demo app?
This cannot be reproduced in Shaka Player demo app, since there is no mean to interrupt/abort a download operation from the Demo UI. (correct me if I am wrong)
What browser and OS are you using?
Chrome in a VMP-signed Electron.
For embedded devices (smart TVs, etc.), what model and firmware version are you using?
N/A
What are the manifest and license server URIs?
This is not specific to a manifest nor a specific license server.
What configuration are you using? What is the output of
player.getConfiguration()
?See code sample below.
What did you do?
My app basically revolves around downloading some content, but also being able to cancel an ongoing download. It is important that when a download is interrupted, the fetching of segments operations are indeed stopped and the manifest-v5 table does not contain the interrupted download anymore.
Here is the code that runs when the download button is clicked :
The code that basically runs when the user clicks on the CANCEL button to cancel an ongoing download is the following :
What did you expect to happen?
I expect :
manifest-v5
table ofshaka_offline_db
database in IndexedDB(I would be OK with a few extra progress events sent and even a couple of orphaned segments in IndexedDB after the download has been interrupted/canceled)
What actually happened?
Sometimes, but not always (I'd say one out of two times), when I click on the button to cancel the download in progress, the download actually continues, right to the end (100%). At the end, the manifest-v5 table contains the download I had interrupted!
What I've observed is that when the download interruption is successful, a
shaka.util.Error.Code.OPERATION_ABORTED
exception is thrown by the call tostore()
. I can then catch this error in my code and make the current download disappear from my UI. For me, this exception is indeed a sign that the download cancellation has been successful.But sometimes (I'd say one out of two times), this error isn't thrown by
store()
following a call toabort()
, so the download continues, as if I hadn't calledabort()
.At this point, the user needs to click a couple of times on the cancel() button until the cancellation eventually occurs...
At first I thought that this problem of the interrupt not working only appear if you interrupt the download very quickly at the beginning, but in fact it can occur at any time during the download.
Note #1 : I have also observed that a couple of progress events are sent to the progressCallback, even if the download has already been interrupted (meaning after I have caught the
shaka.util.Error.Code.OPERATION_ABORTED
exception), but this is not a problem to me, I can easily ignored those events.Note #2 : I have also observed that after a download is successfully interrupted, there are most of time always a couple of orphaned segments left in the
segment-v5
table. I think this another issue to address, not related to the interruption of the download.The text was updated successfully, but these errors were encountered: