-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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(core): Do not user util.types.isProxy
for tracking of augmented objects
#5836
fix(core): Do not user util.types.isProxy
for tracking of augmented objects
#5836
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
Make sure to check off this list before asking for review. |
) | ||
return value; | ||
|
||
// Track augmented objects to prevent infinite recursion in cases where an object contains circular references | ||
augmentedObjects.add(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will hold on references to these objects forever, and lead to a memory-leak.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nevermind. I forgot that WeakSet would not block the GC.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5836 +/- ##
=======================================
Coverage 14.83% 14.84%
=======================================
Files 2475 2475
Lines 113367 113368 +1
Branches 17702 17703 +1
=======================================
+ Hits 16823 16824 +1
Misses 95999 95999
Partials 545 545
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
Got released with |
This PR updates the
augment
function inutils.ts
to use aWeakSet
to track objects that have already been augmented. This prevents infinite recursion in cases where an object contains circular references.Previously, the
augment
function used theisProxy
function from theutil
module to check if an object had already been augmented. However, this caused issues when running in browser environment where theutil
module was not available.Github issue / Community forum post (link here to close automatically): #5769