-
Notifications
You must be signed in to change notification settings - Fork 49
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
IDB version error #57
Comments
This should be taken care of automatically for you, here's the relevant code in the IndexedDB adapter: let version = parseInt(localStorage.getItem(this._id + "-idb-version") || "") || 1;
const modelHash = localStorage.getItem(this._id + "-idb-hash") || this._modelHash;
if (modelHash !== this._modelHash) {
version++;
}
localStorage.setItem(this._id + "-idb-version", String(version));
localStorage.setItem(this._id + "-idb-hash", this._modelHash);
indexedDB.open(this._id, version) Basically the indexedDB version is stored in localStorage, then when the data model is updated the version is incremented. What happened in your case is likely a result of localStorage getting cleared out but not IndexedDB. In any case, there's a new optional config property: Update is live on NPM in |
Our company's group policy wipes cookies and localstorage after each session, hence the issue. I implemented a workaround by checking for a connection outside of NanoSQL and incrementing the version number until we get a hit. Thanks for the response. Loving NanoSQL! |
Perfect, marking this one resolved! |
Hi again
After modifying the schema of an IDB database a few times I get a connection error:
DOMException: The requested version (1) is less than the existing version (24).
In the docs, I can't see a way to specify the version?
Is there an ability to do so, or can it be included?
ta!
The text was updated successfully, but these errors were encountered: