Skip to content

Commit

Permalink
fix(pg): do not replace argument with plain object (open-telemetry#1432)
Browse files Browse the repository at this point in the history
  • Loading branch information
unflxw committed May 11, 2023
1 parent 79cd677 commit e691537
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,7 @@ export class PgInstrumentation extends InstrumentationBase {
callback = context.bind(context.active(), callback);
}

// Copy the callback instead of writing to args.callback so that we
// don't modify user's original callback reference
args[0] = { ...(args[0] as object), callback };
(args[0] as { callback?: PostgresCallback }).callback = callback;
}
}

Expand Down

0 comments on commit e691537

Please sign in to comment.