Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offline Storage fails with IDB error #1230

Closed
Moiahbabi opened this issue Jan 17, 2018 · 9 comments
Closed

Offline Storage fails with IDB error #1230

Moiahbabi opened this issue Jan 17, 2018 · 9 comments
Assignees
Labels
flag: Why didn't we catch this sooner This issue is embarassing; we may still need an automated test that could have prevented this issue status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@Moiahbabi
Copy link

Have you read the FAQ and checked for duplicate issues: Yes.
What version of Shaka Player are you using: 2.3.0
Can you reproduce the issue with our latest release version: Yes.
Can you reproduce the issue with the latest code from master: I used the Demo app
Are you using the demo app or your own custom app: Both.
If custom app, can you reproduce the issue using our demo app:

What browser and OS are you using:
Chrome version 63.0.3239.132 (Official Build) (64-bit), Windows 10 (OS Build 16299.192)
What are the manifest and license server URIs: Demo App Manifests list

(you can send the URIs to shaka-player-issues@google.com instead, but please use GitHub and the template for the rest)

What did you do?
loading Sintel 4k (MP4 only/WebM only), and clicking the store button.

What did you expect to happen?
Successful Offline storage & playback.

What actually happened?
Got this error:
Failed to execute 'add' on 'IDBObjectStore': The object store uses out-of-line keys and has no key generator and the key parameter was not provided.

@joeyparrish joeyparrish added needs triage type: bug Something isn't working correctly and removed needs triage labels Jan 17, 2018
@joeyparrish joeyparrish added this to the v2.4.0 milestone Jan 17, 2018
@joeyparrish
Copy link
Member

Confirmed. Reproduced on the first try for me in Chrome with the latest code.

@joeyparrish joeyparrish changed the title Offline Storage Offline Storage fails with IDB error Jan 17, 2018
@joeyparrish joeyparrish added the flag: Why didn't we catch this sooner This issue is embarassing; we may still need an automated test that could have prevented this issue label Jan 17, 2018
@joeyparrish
Copy link
Member

We are working on a fix. As a work-around, you can clear your IndexedDB storage in the Chrome debugger.

@joeyparrish
Copy link
Member

This affects all app upgrades to v2.3 where there was any offline content stored by an earlier version. All v2.3.x releases are affected.

@joeyparrish
Copy link
Member

We are going to implement the quickest fix we can for this issue: a new error code to detect upgrade issues and a new method to delete the existing database. This will allow applications to recover from this issue, albeit at the expense of any content already stored by end-users. The changes will appear in our next release, v2.3.2.

@joeyparrish
Copy link
Member

To track the long-term fix, in which we will support reading data from older versions, subscribe to #1248.

@Moiahbabi
Copy link
Author

I was able to store/read/delete offline content once I deleted the old database. however, I just want to note that reading/deleting data from old databases (in my case v2.2.7) worked just fine, but adding new content to the old db was not possible due to this error. this was tested on my custom app.

thanks.

@joeyparrish
Copy link
Member

We are unable to add new content because of a problem in the schema of the upgraded tables. During our investigations, we found that the mis-upgraded tables were only part of the problem. Larger tables could not be upgraded at all, leaving the v2.2 content completely inaccessible if it is over a certain size.

@vaage
Copy link
Contributor

vaage commented Jan 26, 2018

We have removed the upgrade code using this list of CLs:

965dc8e
c168ee8
9e89a90
4147e77
bd2b163
With these CLs, if your storage needs to upgrade, the storage operation will fail with the error UNSUPPORTED_UPGRADE_REQUEST. If you catch this you can delete the database backing storage by using shaka.offline.Storage.deleteAll. In the error, data[0] will have a list of original content uris so that you can re-download all the content again.

To get updates on progress on supporting older storage version, please follow #1248.

@vaage vaage closed this as completed Jan 26, 2018
@joeyparrish
Copy link
Member

Fixes cherry-picked for v2.3.2

joeyparrish pushed a commit that referenced this issue Jan 30, 2018
This removed all of DBUpgrade (lib and test) as it was not accomplishing
its requirements.

Now instead, if DBEngine detects that there needs to be an upgrade, it will
abort the upgrade and message the app with |UNSUPPORTED_UPGRADE_REQUEST|.

Issue #1230
Issue #1248

Change-Id: If65bc013b0482c9b0c6e71e644e9132584984414
joeyparrish pushed a commit that referenced this issue Jan 30, 2018
Expose a function through Storage to allow developers to delete the
database that backs storage.

Issue #1230
Issue #1248

Change-Id: Icb20b6c43966a299d8903b2d14f33666f672bd15
joeyparrish pushed a commit that referenced this issue Jan 30, 2018
Create tests to show that DBEngine should not open unless it has
the correct version.

Issue #1230
Issue #1248

Change-Id: I410e1c5d35a3a7b9e91afdd247f06ffac8d5a86d
joeyparrish pushed a commit that referenced this issue Jan 30, 2018
When DBEngine aborts because of an upgrade, include a list of the
original uris for all downloaded content.

This will allow apps to re-download the content if they choose to.

Closes #1230
Issue #1248

Change-Id: Ic2029d935dd8da60c0d502cd0cdbb08b38bbbe76
shaka-bot pushed a commit that referenced this issue Feb 1, 2018
Issue #1230
Issue #1248

Change-Id: Ia3942d8f6fc1b6c5e0166f86aa6620625f75d0db
joeyparrish added a commit that referenced this issue Feb 1, 2018
Issue #1230
Issue #1248

Change-Id: Ia3942d8f6fc1b6c5e0166f86aa6620625f75d0db
@shaka-project shaka-project locked and limited conversation to collaborators Mar 27, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flag: Why didn't we catch this sooner This issue is embarassing; we may still need an automated test that could have prevented this issue status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants