mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix concurrency issue with yielding runHandler.
All tests now pass.
This commit is contained in:
@@ -195,7 +195,7 @@ _.extend(Meteor._SessionCollectionView.prototype, {
|
||||
var clearedResult = [];
|
||||
var docView = self.documents[id];
|
||||
if (!docView)
|
||||
throw new Error("Could not find element with id " + id + "to change");
|
||||
throw new Error("Could not find element with id " + id + " to change");
|
||||
_.each(changed, function (value, key) {
|
||||
docView.changeField(subscriptionId, key, value, changedResult);
|
||||
});
|
||||
@@ -671,15 +671,21 @@ _.extend(Meteor._LivedataSession.prototype, {
|
||||
// all subscriptions
|
||||
_setUserId: function(userId) {
|
||||
var self = this;
|
||||
self.userId = userId;
|
||||
self._isSending = false;
|
||||
var beforeCVs = self.collectionViews;
|
||||
self.collectionViews = {};
|
||||
|
||||
self._eachSub(function (sub) {
|
||||
sub._resetSubscription();
|
||||
});
|
||||
|
||||
var beforeCVs = self.collectionViews;
|
||||
self.collectionViews = {};
|
||||
self.userId = userId;
|
||||
|
||||
self._eachSub(function (sub) {
|
||||
sub.userId = self.userId;
|
||||
sub._runHandler();
|
||||
});
|
||||
|
||||
self._isSending = true;
|
||||
|
||||
self._diffCollectionViews(beforeCVs);
|
||||
|
||||
Reference in New Issue
Block a user