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

pureComputed outdated value when ko.deferUpdates = true #2571

Open
miellaby opened this issue Jun 9, 2021 · 1 comment
Open

pureComputed outdated value when ko.deferUpdates = true #2571

miellaby opened this issue Jun 9, 2021 · 1 comment
Labels

Comments

@miellaby
Copy link
Contributor

miellaby commented Jun 9, 2021

Knockout 3.4 with ko.deferUpdates = true

I can't use a pure computed immediately after its dependency (another pure computed in front of 2 observables) is updated. The returned value is outdated.

With a debugger, I see that the problematic pureComputed is asleep but not "isStale". Everything look fine otherwise. It is not disposed and has the correct subscription on its unique dependency.

I suppose that because of deferred updates, the pureComputed has not been notified yet that its dependency was updated.

executing ko.tasks.runEarly() after updating the pureComputed dependency fixes the issue.

I'll try to do a jsfiddle to spot the exact problem. But I wonder if it's a known issue to begin with? It's quite a deal breaker IMHO.

@mbest
Copy link
Member

mbest commented Sep 6, 2021

The latest version is 3.5.1. Please try with the latest version and let use know if you still see the problem.

@mbest mbest added the waiting label Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants