GithubHelp home page GithubHelp logo

Version stays at 1 about kvs HOT 5 CLOSED

azu avatar azu commented on July 22, 2024
Version stays at 1

from kvs.

Comments (5)

azu avatar azu commented on July 22, 2024 1

// if user set newVersion, upgrade it
if (oldVersion !== version) {
return Promise.resolve(
onUpgrade({
oldVersion,
newVersion: version,
storage
})
).then(() => {
return storage;
});
}

Maybe, we need to write version to storage.

TODO

  • Add tests
  • Fix storage implementation

from kvs.

azu avatar azu commented on July 22, 2024

Can you provide reproduce example?

browser:

(async () => {
  const { kvsEnvStorage } = await import("https://cdn.skypack.dev/@kvs/[email protected]");
  const storage = await kvsEnvStorage({
    name: "database-name",
    version: 2,
    async upgrade({ kvs, oldVersion, newVersion }) {
      console.log({
        oldVersion, // 0
        newVersion // 2
      });
    }
  });
})();

node:

https://replit.com/@azu2/kvs-env-new-version?v=1#index.js

from kvs.

Kalabasa avatar Kalabasa commented on July 22, 2024

It is reproducible it in your node replit example. Check ~/kvs-env-new-version/.cache/kvs-node-localstorage/database-name.__.__kvs_version__. Version is always 1, regardless of the version in the app.

from kvs.

Kalabasa avatar Kalabasa commented on July 22, 2024

Another example:
https://replit.com/@Kalabasa-/kvs-env-new-version#index.js

from kvs.

azu avatar azu commented on July 22, 2024

Fixed in https://github.com/azu/kvs/releases/tag/v2.1.3

from kvs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.