Skip to content

Commit

Permalink
fixed _meta in pubsub
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Bishop authored and Simon Bishop committed Jul 11, 2016
1 parent 7614475 commit 84afef1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
4 changes: 2 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
- fixed issue where non-iterable _meta doesnt make it through to the client on websocket connections
- made _meta non-enumerable for websockets and eventemitter

2.9.3 2016-07-11
----------------
2.9.3 2.9.4 2016-07-11
----------------------

- adjusted back to making _meta enumerable, as this causes issues in happner, also _meta is useful in a lot of instances
11 changes: 1 addition & 10 deletions lib/services/pubsub/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,7 @@ PubSubService.prototype.formatReturnItem = function (item, local) {
if (!item.data) item.data = {};

var returnItem = item.data;

if (local){
//means we are returning this item to an intra-proc client
//so the data is not serialized via JSON, and thus the _meta
//will successfully cross over.
Object.defineProperty(returnItem, '_meta', {
value:item._meta
})
}else returnItem._meta = item._meta;//the websocket client handles the response, and formats the return values (makes _meta non-enumerable)

returnItem._meta = item._meta;

return returnItem;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "happn",
"description": "pub/sub api as a service using primus and mongo & redis or nedb, can work as cluster, single process or embedded using nedb, use in production at your own risk",
"version": "2.9.3",
"version": "2.9.4",
"main": "./lib/index",
"scripts": {
"test": "mocha --expose-gc silence.js test",
Expand Down

0 comments on commit 84afef1

Please sign in to comment.