-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix: Don't send JavaScript objects across isolates #2
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
Conversation
@codecov-ai-reviewer review |
On it! We are reviewing the PR and will provide feedback shortly. |
PR DescriptionThis pull request modifies the native stack trace capture functionality to return stack traces as formatted strings instead of structured objects. The primary goal is to align the stack trace format with the standard Node.js stack trace format, making it easier to integrate with existing tooling and libraries that expect this format. Click to see moreKey Technical ChangesThe core change is in Architecture DecisionsThe decision to return string-based stack traces simplifies the native module's API and reduces the overhead of creating JavaScript objects in the C++ code. The adoption of Dependencies and InteractionsThis pull request introduces a new dependency on the Risk ConsiderationsThe primary risk is a breaking change for existing users of the library who are consuming the structured stack trace data. While the new string format is more standard, it requires users to update their code to parse the strings if they need structured data. There's also a risk that the string formatting in Notable Implementation DetailsThe |
66c7970
to
b6d5cf1
Compare
b6d5cf1
to
9cff6f0
Compare
The primary goal is to fix the object corruption on some architectures which suggests something is not right. I could create intermediate (non-v8) objects to safely pass between the threads and then build the javascript objects in the correct isolate. That way we could retain the existing API which returns |
Closing in favour of #4 |
I found some intermittent test failures on some architectures.
I have diagnosed this as probably being caused by creating JavaScript objects in one isolate and returning them in another isolate.
This PR changes the module so it now it only passes strings between threads. It now returns a synthetic stack string for each thread which match the format of Node.js stack strings. This is probably preferable since this is less Sentry specific that the previous objects. We can also now pass these stack strings through the Sentry Node stack parser (as seen in the tests) and we get the additional
in_app
andmodule
populated.