kadirahq / fast-render

Render you app even before the DDP connection is live. - magic?
MIT License
560 stars 80 forks source link

Problem when using with artwells/meteor-accounts-guest #142

Open alansikora opened 8 years ago

alansikora commented 8 years ago

There is a problem at PublishContext, line 44:

PublishContext.prototype.changed = function(collection, id, fields) {
  var collectionData = this._collectionData;

  collectionData[collection] = collectionData[collection].map(function(doc) {
    if (doc._id === id) {
      return _.extend(doc, fields);
    }

    return doc;
  });
};

It tries to map to an undefined array when using artwells/meteor-accounts-guest package.

I'm on a really tight deadline so I could not really study the reasons, but I believe we need to keep that map safe by making a simple change.

brettle commented 8 years ago

PR #154 fixes this.