bugsnag / bugsnag-node

[DEPRECATED] Please upgrade to our Universal JS notifier "@bugsnag/js" • https://github.com/bugsnag/bugsnag-js
https://www.bugsnag.com/
MIT License
48 stars 55 forks source link

Add tests for serializing a payload, improve performance #108

Closed kattrali closed 7 years ago

kattrali commented 7 years ago

Added a few tests for avoiding circular references when serializing a Notification to JSON. It revealed some false positives around sibling objects, and generally poor performance overall since a reference to every object encountered is kept until the process is complete.

The existing serialization and cycle detection logic was replaced with json-stringify-safe, which handles the test cases correctly.

Fixes #96