Skip to content

fix(node): Apply source context to linked errors even when it is uncached#8453

Merged
lforst merged 2 commits intodevelopfrom
lforst-fix-source-context-for-node-linked-errors
Jul 5, 2023
Merged

fix(node): Apply source context to linked errors even when it is uncached#8453
lforst merged 2 commits intodevelopfrom
lforst-fix-source-context-for-node-linked-errors

Conversation

@lforst
Copy link
Copy Markdown
Contributor

@lforst lforst commented Jul 5, 2023

When I looked into the linked errors integration to implement support for Aggregate erros I noticed that in the node linked errors integration we had an await that did nothing.

This was a bit curios to me since all of the functions in the node linked errors integration were async just because of that await. Looking into it some more it seems that we used the wrong funciton of the context lines integration to attach source context. We were only attaching source context if the file was in our file cache - this operation is synchronous. We basically just called the wrong fuction of the context lines integration (addSourceContextToFrames instead of addSourceContext).

This pr changes the node linked errors integration to add source (cached AND uncached) source context to linked errors after they have been attached to the event. Also gets rid of some unnecessary sync promise, async await shenanigans.

@lforst lforst changed the title fix(node): Apply source context to linked errors when it is uncached fix(node): Apply source context to linked errors even when it is uncached Jul 5, 2023
@lforst lforst merged commit c55943f into develop Jul 5, 2023
@lforst lforst deleted the lforst-fix-source-context-for-node-linked-errors branch July 5, 2023 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants