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

fix: pass backwards-compatible level-js options #215

Merged
merged 4 commits into from
Nov 29, 2019
Merged

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Nov 25, 2019

Between level-js@2 and level-js@4 it started passing version numbers into indexedDB.open so we have to specify these now. It also prefixes locations with a disambiguator, which we need to set to blank for browsers to still be able to read their previously created databases.

Depends on:

@vweevers
Copy link

vweevers commented Nov 29, 2019

it started passing version numbers

Hm, this was actually intended to maintain backwards compatibility. Because before level-js@3, it used IDBWrapper which also passed a version number into indexedDB.open.

It also prefixes locations with a disambiguator, which we need to set to blank for browsers to still be able to read their previously created databases.

In addition, IDBWrapper had a default prefix, so databases created with level-js < 3 do in fact have a prefix. Unless... at that time, ipfs passed an empty prefix to level-js, and IDBWrapper did support that.. yeah that makes sense.

@achingbrain achingbrain mentioned this pull request Nov 29, 2019
@achingbrain
Copy link
Member Author

@jacobheun if you're happy with this could you please release it & backport it to 0.29.x so we can do a patch release for [email protected] and fix ipfs/js-ipfs#2629?

Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jacobheun jacobheun merged commit 6286167 into master Nov 29, 2019
@jacobheun jacobheun deleted the fix-level-options branch November 29, 2019 17:09
achingbrain added a commit that referenced this pull request Nov 29, 2019
* fix: pass backwards-compatible level-js options

* fix: fix options test

* fix: configure datastore prefix and get right level version
achingbrain added a commit that referenced this pull request Nov 29, 2019
* fix: pass backwards-compatible level-js options

* fix: fix options test

* fix: configure datastore prefix and get right level version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants