diff --git a/src/Database.js b/src/Database.js index d733e18a..9977b589 100644 --- a/src/Database.js +++ b/src/Database.js @@ -341,8 +341,12 @@ module.exports = function (Y) { } } requestTransaction (makeGen, callImmediately) { - if (callImmediately) { - this.transact(makeGen) + if (callImmediately || true) { + this.waitingTransactions.push(makeGen) + if (!this.transactionInProgress) { + this.transactionInProgress = true + this.transact(this.getNextRequest()) + } } else { this.waitingTransactions.push(makeGen) if (!this.transactionInProgress) { diff --git a/src/Types/Map.spec.js b/src/Types/Map.spec.js index 2aa9e241..e07d50ad 100644 --- a/src/Types/Map.spec.js +++ b/src/Types/Map.spec.js @@ -3,7 +3,7 @@ 'use strict' var Y = require('../SpecHelper.js') -var numberOfYMapTests = 100 +var numberOfYMapTests = 500 var repeatMapTeasts = 1 for (let database of databases) { diff --git a/src/y.js b/src/y.js index c0c8d4fd..91927475 100644 --- a/src/y.js +++ b/src/y.js @@ -85,7 +85,9 @@ class YConfig { yield* this.store.tryExecute.call(this, model) var root = yield* this.getType(model.id) this.store.y.root = root - callback() + setTimeout(function () { + callback() + }, 0) }) } isConnected () {