Skip to content

Commit

Permalink
fix RangeError: Maximum call stack size exceeded] error
Browse files Browse the repository at this point in the history
  • Loading branch information
nanopx committed Feb 12, 2015
1 parent f1d01e3 commit 4a52a3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### master

* [BUGFIX] Fix [RangeError: Maximum call stack size exceeded] error in PubSub hook
* [ENHANCEMENT] Support layout for Ractive template engine


Expand Down
6 changes: 5 additions & 1 deletion lib/hooks/pubsub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ module.exports = function(sails) {
var id = record[this.primaryKey] || record;
// Get the socket room to publish to
var room = this.room(id, "message");

// Ensure that we're working with a clean, unencumbered object
data = _.cloneDeep(data);

// Create the payload
var payload = {
verb: "messaged",
Expand Down Expand Up @@ -537,7 +541,7 @@ module.exports = function(sails) {
options = options || {};

// Ensure that we're working with a clean, unencumbered object
changes = _.clone(changes);
changes = _.cloneDeep(changes);

// Enforce valid usage
var validId = _.isString(id) || _.isFinite(id);
Expand Down

0 comments on commit 4a52a3b

Please sign in to comment.