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

🐛 Fix instrumention of null function with 3rd party wrapper (#1570) #1697

Merged
merged 5 commits into from
Aug 25, 2022
Merged

🐛 Fix instrumention of null function with 3rd party wrapper (#1570) #1697

merged 5 commits into from
Aug 25, 2022

Conversation

Ryankey
Copy link
Contributor

@Ryankey Ryankey commented Aug 17, 2022

Motivation

Issue #1570 is causing noisy errors when wrapping a null/undefined method that also has third party wrappers.

Changes

Adds a condition when executing a wrapped function to protect against the case when we "unwrap" the function ourselves and set it to null (its previous value).

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

A simple solution for #1570. It feels like we could also just skip wrapping anything that isn't a function on L11, and immediately returning a no-op stop, but I was less comfortable making that change.
@Ryankey Ryankey requested a review from a team as a code owner August 17, 2022 20:53
@bits-bot
Copy link

bits-bot commented Aug 17, 2022

CLA assistant check
All committers have signed the CLA.

@codecov-commenter
Copy link

Codecov Report

Merging #1697 (e23da72) into main (ed8a9bf) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1697   +/-   ##
=======================================
  Coverage   90.80%   90.80%           
=======================================
  Files         128      128           
  Lines        4762     4764    +2     
  Branches     1061     1062    +1     
=======================================
+ Hits         4324     4326    +2     
  Misses        438      438           
Impacted Files Coverage Δ
packages/core/src/tools/instrumentMethod.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bcaudan bcaudan merged commit 40e4d60 into DataDog:main Aug 25, 2022
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.

5 participants