Skip to content

fix(cache): prevent retained elements with weak dependency contexts - #311

Merged
smalluban merged 1 commit into
mainfrom
fix/cache-weakref
Sep 9, 2026
Merged

fix(cache): prevent retained elements with weak dependency contexts#311
smalluban merged 1 commit into
mainfrom
fix/cache-weakref

Conversation

@smalluban

Copy link
Copy Markdown
Contributor

Long-lived store cache entries can retain detached custom elements through strong reverse dependency links. Fixes #310.

Use stable WeakRef contexts and FinalizationRegistry cleanup so discarded elements can be collected while retained elements continue receiving dependency invalidations. Add regression tests for weak-link cleanup and element reconnection without changing lifecycle invalidation behavior.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 99.958% (+0.001%) from 99.957% — fix/cache-weakref into main

@smalluban
smalluban merged commit 778ebd4 into main Sep 9, 2026
2 checks passed
@smalluban
smalluban deleted the fix/cache-weakref branch September 9, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Custom elements using store-backed properties can be kept alive by the 'contexts' set of long-lived cache entries

2 participants