Fixes a cache-invalidation bug for SignalingList#3486
Merged
Conversation
ObservableListSignalingList
|
Performance benchmarks:
|
Member
|
Could you add a test that illustrates the bug as well? Otherwise, this looks good. |
Collaborator
Author
Good call, I was unintentionally returning that same |
quaquel
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a cache-invalidation bug for
SignalingList. See #3481Motivation
Because mutable lists mutate in-place, the reactive graph's
current_val != old_valcheck compares the list's memory address against itself. It always evaluates toFalse, causing the@computed_propertyto return a stale cache. Furthermore, storing the actual list object inComputedStatetraps massive data structures in memory.Implementation
Passed
Noneto the dependency tracker whenever the accessed value is aMutableSequence. This keeps the list out of theComputedStateand ensures in-place mutations successfully bypass theold != newcache check. Immutable standard observables remain unaffected.Closes #3481