Coder Social home page Coder Social logo

Comments (11)

raix avatar raix commented on May 18, 2024

I've had this issue myself - I think grounddb is missing a version lock on minimax - not sure - anyways I'm working grounddb at the moment - so there should be a lot of progress the next couple of days.
//try localstorage.clear()

from ground-db.

waeltken avatar waeltken commented on May 18, 2024

Thanks for the quick reply. Thats great news. I've been using GroundDB for an earlier demo before and it worked amazingly well ootb.
Tried localStorage.clear() already...

from ground-db.

raix avatar raix commented on May 18, 2024

I'm doing a rewrite of grounddb at the moment - I hope it will be more stable/easier to test/debug/contribute

from ground-db.

jakobdamjensen avatar jakobdamjensen commented on May 18, 2024

@raix @waeltken it seems like it's a bug in the load/save object methods which stores a string that can't be parsed again. Adding JSON.stringify and JSON.parse to save and load fixes this. But I'm not sure if this is an ideal solution

// save object into localstorage
_gDB._saveObject = function(name, object) {
  if (_gDB.storage && _gDB._isReloading === false) {
    var cachedDoc = object && EJSON.minify(object);
    try {
      _gDB.storage.setItem(_gDB._getGroundDBPrefix(name), JSON.stringify(cachedDoc));
    } catch (e) {
      GroundDB.onQuotaExceeded();
    }
  }
};

// get object from localstorage, retur null if not found
_gDB._loadObject = function(name) {
  // If storage is supported
  if (_gDB.storage) {
    // Then load cached document
    var cachedDoc = JSON.parse(_gDB.storage.getItem(_gDB._getGroundDBPrefix(name)));
    return (cachedDoc)? EJSON.maxify(cachedDoc): null;
  }
  return null;
};

from ground-db.

waeltken avatar waeltken commented on May 18, 2024

@jakobdamjensen: Is this sufficient to get GroundDB working again?

@raix told me he is working on a new restructured release of GroundDB.
I'll try to wait until he releases that and then work from there.

from ground-db.

jakobdamjensen avatar jakobdamjensen commented on May 18, 2024

@waeltken yes it is.. At least in my demo app..

from ground-db.

waeltken avatar waeltken commented on May 18, 2024

I can confirm that this brings v.0.0.21 back to life! I can send you a pull request based on @jakobdamjensen suggestions and v0.0.21 if you like.

from ground-db.

raix avatar raix commented on May 18, 2024

@waeltken I guess it makes sense to move the refactoring to a separate branch - I'll see if its possible

from ground-db.

raix avatar raix commented on May 18, 2024

pr yes :)

from ground-db.

raix avatar raix commented on May 18, 2024

@waeltken master should be at 0.0.21 now

from ground-db.

raix avatar raix commented on May 18, 2024

I've pushed ground:db should work - closing this

from ground-db.

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.