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 leaking of original object from ko.observableArray #1893

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

exyi
Copy link
Member

@exyi exyi commented Dec 15, 2024

ko.observableArray would leak the original object to its 'arrayChanges' subscribers when instance method (such as 'push', 'splice') was used to modify the array. Knockout would pre-compute the diff passed to the subscribers before our validator was called.

  • Knockout updated to b7b150a6 to remove an optimization which was the primary cause
  • Made FakeObservableObject internal properties non-enumerable so make sure they don't propagate through coercer when assigned into an array.

ko.observableArray would leak the original object to its 'arrayChanges'
subscribers when instance method (such as 'push', 'splice') was used
to modify the array. Knockout would pre-compute the diff passed
to the subscribers before our validator was called.

* Knockout updated to b7b150a6 to remove an optimization which was the primary cause
* Made FakeObservableObject internal properties non-enumerable so
   make sure they don't propagate through coercer when assigned
   into an array.
@exyi exyi added the bug label Dec 15, 2024
@exyi exyi added this to the Version 4.3 milestone Dec 15, 2024
@exyi exyi requested a review from tomasherceg December 15, 2024 21:28
@tomasherceg tomasherceg merged commit 989a263 into main Dec 20, 2024
14 of 19 checks passed
@tomasherceg tomasherceg deleted the fix-observable-array-original-object-leak branch December 20, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants