You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if you have a seneca instance (seneca1) calling another seneca instance (seneca2) which calls another seneca instance (seneca3), (sounds long but it should be pretty legit) if the last one, seneca3, return an error, its caller (seneca2) will throw the error: Error:Converting circular structure to JSON and will never reply about the error to its caller seneca2
constBoom=require('boom');constseneca1=require('seneca')({tag: 'seneca1'});constseneca2=require('seneca')({tag: 'seneca2'});constseneca3=require('seneca')({tag: 'seneca3'});seneca1.client({port:4000,pin: 'cmd:test1'}).add('cmd:test',function(msg,reply){constseneca=this;seneca.act('cmd:test1',function(err,res){returnreply(err,res);})}).listen(3000);seneca2.client({port:5000,pin: 'cmd:test2'}).add('cmd:test1',function(msg,reply){constseneca=this;seneca.act('cmd:test2',function(err,res){returnreply(err,res);})}).listen(4000);seneca3.add('cmd:test2',function(msg,reply){consterr=newBoom('this error will cause seneca2 to throw a JSON stringify circular error @ seneca-transport http.js')returnreply(err);}).listen(5000);setTimeout(function(){seneca1.act('cmd:test',function(err){// this will time out because line 23 will never be called//console.log(err);})},3000);
TypeError: Converting circular structure to JSON
at JSON.stringify ()
at module.exports.internals.Utils.internals.Utils.stringifyJSON (/Users/davide_talesco/development/crap/seneca/errorHandling3/node_modules/seneca-transport/lib/transport-utils.js:563:17)
at Object.internals.sendResponse (/Users/davide_talesco/development/crap/seneca/errorHandling3/node_modules/seneca-transport/lib/http.js:256:29)
at /Users/davide_talesco/development/crap/seneca/errorHandling3/node_modules/seneca-transport/lib/http.js:242:15
at Seneca. (/Users/davide_talesco/development/crap/seneca/errorHandling3/node_modules/seneca-transport/lib/transport-utils.js:260:7)
at Object.intern.handle_reply (/Users/davide_talesco/development/crap/seneca/errorHandling3/node_modules/seneca/seneca.js:1311:13)
at Seneca.action_reply (/Users/davide_talesco/development/crap/seneca/errorHandling3/node_modules/seneca/seneca.js:906:24)
at Seneca. (/Users/davide_talesco/development/crap/seneca/errorHandling3/root.js:23:14)
at Object.intern.handle_reply (/Users/davide_talesco/development/crap/seneca/errorHandling3/node_modules/seneca/seneca.js:1311:13)
at Seneca.action_reply (/Users/davide_talesco/development/crap/seneca/errorHandling3/node_modules/seneca/seneca.js:906:24) {stack: TypeError: Converting circular structure to JSON
…orHandling3/node_modules/seneca/seneca.js:906:24),
message: Converting circular structure to JSON}
@rjrodger Any idea when someone will take this project back to life?
It is a pity such a good project and no one to taking care of it.
I would be very happy to help, but the seneca community, seems non existent and feels very hard to contribute.
I am not too sure if seneca is still being developed at all and I wonder if anyone is still actively using it.
Davide
The text was updated successfully, but these errors were encountered:
I have incorporated this test into the main seneca repo - thanks!
However, it only passes on the new transport implementation (which is still in beta until seneca 4).
If you are still up for helping, please update seneca-transport to fix this - I am happy to grant access etc as needed.
Yes, seneca is in use - running my new startup! https://github.com/voxgig
A safer option, with no data loss, would be to use something like this: https://github.com/douglascrockford/JSON-js to safely serialize and deserialize a circular structure to JSON without data loss.
a simpler and more efficient solution, could be to just remove the IncomingMessage from the response object?
what do you think? how come the new transport is not affected by this issue?
All tests pass, but I am not too sure if internals.Utils.prototype.stringifyJSON is used anywhere else where the inevitable data loss of the replacer might cause unexpected side effect.
Hi all,
if you have a seneca instance (seneca1) calling another seneca instance (seneca2) which calls another seneca instance (seneca3), (sounds long but it should be pretty legit) if the last one, seneca3, return an error, its caller (seneca2) will throw the error: Error:Converting circular structure to JSON and will never reply about the error to its caller seneca2
the error happen here:
seneca-transport/lib/http.js
Line 256 in ec30ca4
and this is the stacktrace:
@rjrodger Any idea when someone will take this project back to life?
It is a pity such a good project and no one to taking care of it.
I would be very happy to help, but the seneca community, seems non existent and feels very hard to contribute.
I am not too sure if seneca is still being developed at all and I wonder if anyone is still actively using it.
Davide
The text was updated successfully, but these errors were encountered: