Code Monkey home page Code Monkey logo

Comments (9)

louischatriot avatar louischatriot commented on July 21, 2024

This seems very much like a bug where the executor would stop executing command if one command (insert/find/update/remove) had been called without a callback (even though you should be able to do that).

My guess is that you don't give a callback to the remove function and so after that no command gets treated until your page is reloaded and the database created.

To test this you could simply do two inserts at once without a callback, in a new db (i.e. no datafile). If there is only one line that means it is indeed the bug I described. In that case, it was fixed some time ago (v0.7.13 I think) so simply using NeDB's latest version should do the trick. Please tell me if that's the case.

from nedb.

 avatar commented on July 21, 2024

I'm 99% sure I'm using the latest (synced today) nedb - however the delete doesn't have (or need) a callback, I'll see what happen if I insert one (I'll do a random db.find())

from nedb.

 avatar commented on July 21, 2024

Yeah, putting something into the callback for the delete seems to solve this - this is with the latest npm release too.

from nedb.

louischatriot avatar louischatriot commented on July 21, 2024

In that case this is clearly not the expected behaviour. Cold you give me a reproducible test case so I can solve this?

Le 11 juil. 2013 à 20:28, shrewdlogarithm [email protected] a écrit :

Yeah, putting something into the callback for the delete seems to solve this - this is with the latest npm release too.


Reply to this email directly or view it on GitHub.

from nedb.

 avatar commented on July 21, 2024

It's not easy to make a test case from a node webkit app - and I've changed the way this one works which means it doesn't (easily) reproduce the error any longer (beyond just adding a callback to the delete).

I cannot make a standalone node.js app which reproduces this yet either - I suspect it's not just a straight 'delete everything with no callback' - I think it may be other actions carried out (perhaps also without callbacks) which are impacting on the issue.

I'll have to get back to you if/when I re-run into this one

from nedb.

louischatriot avatar louischatriot commented on July 21, 2024

I can't seem to find a way to reproduce this and I'm not actually sure it's a bug in nedb. Could you just send me your entire script code so that I have a chance to understand what's going on?

from nedb.

 avatar commented on July 21, 2024

My entire code is over 3000 lines over 24 separate files (all of which access the DB in some way) - even the core DB stuff is 400+lines...

What I've discovered is that I can rollback my project to any point-in-time (Webstorm is amazing) so later, I'll backup and do just that - and I'll edit-in a complete trace of all DB activity - which I can then recreate as a testcase in plain node.js

But now I must go into the outside world for it is time to eat!

from nedb.

 avatar commented on July 21, 2024

OK, local history revealed that I updated to the latest NEDB after I first ran into this error (but I was working on something else at the time - this is the value of labelling your source changes!!) - which means my adding the callback didn't fix it - just upgrading NEDB did.

Webstorm is really amazing tho - without it I'd still be manually digging files out of the backup archive!

We can close this as being no longer an issue I think...

from nedb.

louischatriot avatar louischatriot commented on July 21, 2024

Great :)

from nedb.

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.