Meteor-Community-Packages / ground-db

GroundDB is a thin layer providing Meteor offline database and methods
https://atmospherejs.com/ground/db
MIT License
569 stars 76 forks source link

Can't set timers inside simulations #88

Open johanzhe opened 9 years ago

johanzhe commented 9 years ago

I'm getting an error which originates from the _saveDatabase-function, specifically the line self._saveDatabaseTimeout(function() {:

From the console log:

Error: Can't set timers inside simulations at withoutInvocation (http://localhost/packages/meteor.js?:433:13) at bindAndCatch (http://localhost/packages/meteor.js?:441:33) at Object._.extend.setTimeout (http://localhost/packages/meteor.js?:457:23) at oneTimeout [ as _saveDatabaseTimeout ] ( http://localhost/packages/raix_onetimeout.js?:47:17 ) at _saveDatabase (http://localhost/packages/ground_db.js?:548:10) at http://localhost/packages/ground_db.js?:193:19 at http://localhost/packages/raix_eventemitter.js?:122:16 at Array.forEach (native) at Function..each..forEach (http://localhost/packages/underscore.js?:156:11) at _runCallbacks (http://localhost/packages/raix_eventemitter.js?:118:7)

The error occurs when running a method stub on client that contains Tracker.flush().

Meteor.methods({ foo: function (doc) { collection.insert(doc); Tracker.flush(); // ...more code... }});

StorytellerCZ commented 4 months ago

I think might no longer be an issue in the latest version. Keeping it open for a bit longer though.