Repository navigation
fix(abstractions): subscribe list items once and keep list sizes fresh in the backing store - #802
Merged
Vincent Biret (baywet) merged 4 commits intoOct 15, 2026
Conversation
…h in the backing store Each time a list was set, every BackedModel in it got one more subscription. The callback sets the list again, so each change to an item doubled its subscriptions. Items now subscribe under the store's own id plus the property name. A repeat subscription from the same store replaces the old one, and a child shared by two stores still notifies both. The is_initialization_completed setter saved the entry it read before the size check. A list that had grown was saved with its old size and showed up as changed again on the next enumerate_. It now saves the entry after the check, as the C# store does.
Max Azatian (HardMax71)
force-pushed
the
fix/backing-store-subscriptions-and-sizes
branch
from
October 14, 2026 19:25
7c50a5b to
723f291
Compare
Member
|
Max Azatian (@HardMax71) can you look into the failing checks please? |
Contributor
Author
Vincent Biret (@baywet) fixed in 0fa3b1f. pylint flagged reading |
pylint R1733 flagged reading store[key] inside the items() loop. The size check can replace the entry, so the loop now goes over a copy of the keys and reads each entry from the store, like the C# setter.
Vincent Biret (baywet)
approved these changes
Oct 15, 2026
Vincent Biret (baywet)
left a comment
Member
There was a problem hiding this comment.
Thank you for making the changes!
|
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.



Overview
Two more backing store bugs, found while typing the store in #800.
BackedModelin it one more subscription. Each one sets the list again, so every change to an item doubled its subscriptions, 256 after 8 changes. Items now subscribe under the store's own id plus the property name. A repeat subscription from the same store replaces the old one, and a child shared by two stores still notifies both.is_initialization_completedsetter saved the entry it read before the size check. A list that had grown was saved with its old size and showed up as changed right after. It now saves the entry after the check, like the C# store.Related Issue
Follow-up to #800, found while working on #722.
Testing Instructions
pytestinpackages/abstractionspasses.test_list_items_notify_the_store_once_per_changeandtest_completing_initialization_clears_a_resized_listfail.test_list_item_shared_by_two_stores_notifies_bothcovers a child shared by two stores.