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(cache): Clear deps and context when get value from cache #230

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

smalluban
Copy link
Contributor

Relates to #229

Still updating properties in a chain of the observer can lead to out-of-date UI, as the render method is added to the emitter queue when the first of its dependencies has changed. Added test to this PR shows that case - render is called after the prop1 observer, so the prop1 and prop2 are updated, but before the prop3 (it is added to the queue when render is there already).

However, the PR fixes the issue where the state after that action is broken, and render has no deps anymore (before calling host.prop3 = ... cleared out deps/contexts of a whole tree, so render has no deps then, but it also will not be called, as it was called already).

Copy link

codesandbox-ci bot commented Jan 5, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 333ca5a:

Sandbox Source
Hybrids web components playground Configuration

@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 333ca5a on fix-cache-clear-deps-context
into ffba323 on main.

@smalluban smalluban merged commit ec6f8b1 into main Jan 8, 2024
3 checks passed
@smalluban smalluban deleted the fix-cache-clear-deps-context branch January 8, 2024 10:24
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.

2 participants