-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix: traverse graph when time traveling #17095
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
Conversation
Often deriveds are currently unowned but through graph traversal during `is_dirty()` might reconnect to the graph, therefore having dependent effects register themselves as reactions. The problem prior to this fix was that the graph was not traversed to update the derived's dependencies and unowned status of deriveds in batch_values - the batch value was just returned -, which results in reactivity loss. #17024 (comment) contains a detailed rundown of such a case. The fix is to still traverse the graph, though not executing any deriveds in the process. Fixes #17024 Fixes #17049 (comment) (and therefore everything that was still buggy in that issue I think)
|
|
|
Started noodling on an alternative approach in #17102. Interestingly though: when I copied the test in this PR to the sandbox, it worked fine? It only fails when run as a test. Doesn't appear to be a dev/prod discrepancy, I haven't been able to figure out what's going on |
|
Have you increased the timeout in the test file long enough for the playground so you have a chance to click on the button before the async work stops? |
|
do we still need this or is it fully superseded by #17105? |
|
superseeded |
Often deriveds are currently unowned but through graph traversal during
is_dirty()might reconnect to the graph, therefore having dependent effects register themselves as reactions.The problem prior to this fix was that the graph was not traversed to update the derived's dependencies and unowned status of deriveds when batch_values contained the derived - the batch value was just returned then -, which results in reactivity loss. #17024 (comment) contains a detailed rundown of such a case. The fix is to still traverse the graph, though not executing any deriveds in the process or resetting signals.
Fixes #17024
Fixes #17049 (comment) (and therefore everything that was still buggy in that issue I think)
Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lint