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(instrumentation-dataloader): Patch batchLoadFn without creating an instance #2498

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

onurtemizkan
Copy link
Contributor

Related: getsentry/sentry-javascript#13869

Which problem is this PR solving?

  • The current version of the instrumentation creates an instance (and returns it) in order to patch the DataLoader constructor for batchLoadFn. This breaks the usage where the DataLoader class is extended.

Short description of the changes

  • This implementation uses the first argument of the DataLoader constructor (which is batchLoadFn) to patch to avoid creating an instance.

@onurtemizkan onurtemizkan requested a review from a team as a code owner October 23, 2024 17:25
@onurtemizkan onurtemizkan changed the title fix(instrumentation-dataloder): Patch batchLoadFn without creating an instance fix(instrumentation-dataloader): Patch batchLoadFn without creating an instance Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 90.84%. Comparing base (9a20e15) to head (60d8499).

Files with missing lines Patch % Lines
.../instrumentation-dataloader/src/instrumentation.ts 92.85% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2498      +/-   ##
==========================================
- Coverage   90.85%   90.84%   -0.02%     
==========================================
  Files         159      159              
  Lines        7853     7854       +1     
  Branches     1622     1622              
==========================================
  Hits         7135     7135              
- Misses        718      719       +1     
Files with missing lines Coverage Δ
.../instrumentation-dataloader/src/instrumentation.ts 98.07% <92.85%> (-0.96%) ⬇️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant