Skip to content
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

Rollbar browser trace chains duplicate the first stack to all trace chain items #1146

Open
mathewbyrne opened this issue Dec 18, 2024 · 2 comments
Assignees
Labels

Comments

@mathewbyrne
Copy link

Recently I noticed our Typescript Vue app giving me Rollbar items with stacked errors featuring the same error trace:

image

Reaching out to support they informed me this is due to trace_chain being set in the payload, and is indicative that there are two errors, the first being the caught error and the second coming from error.cause.

This makes sense, our error classes do keep track of wrapped errors using cause, however I would expect to see two different stack traces, and in the examples I looked at, the trace was always duplicated.

Digging through the client, I can see support for this was added in #759 and #1012. But I believe there is an issue with this line:

var stack = stackFromItem(item);

For errors with causes, buildTrace is called in a loop, but each iteration continues to use the main stack trace from item. It's likely the line should be:

var stack = stackInfo.stack;

Since stackInfo is set to the current iteration.

More than happy to contribute a PR for this fix.

@waltjones
Copy link
Contributor

@mathewbyrne Thank you for the report, and detailed description. Yes, a PR for this is welcome.

@waltjones waltjones self-assigned this Dec 18, 2024
@waltjones waltjones added the bug label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants