-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Unexpected Update Calls #3290
Comments
Probably simpler example: So it seems that the svelte/src/runtime/internal/scheduler.ts Line 46 in f65ce85
This invalidate will add a dirty component and therefore execute the loop again, triggering an extra beforeUpdate and an extra afterUpdate , but his special seen_callbacks code will prevent the afterUpdate being triggered again for the same cycle:svelte/src/runtime/internal/scheduler.ts Lines 48 to 59 in f65ce85
This checking on |
Exactly, it took me a while to figure it while I was going through my bundle svelte/src/runtime/internal/scheduler.ts Line 46 in f65ce85
before (this can lead to unpredictable side effects, but I can't think of any) svelte/src/runtime/internal/scheduler.ts Lines 40 to 44 in f65ce85
resulting in
or just
|
This is pretty severe. Can't build anything serious with Svelte until this is fixed. |
This appears to have been fixed as of 3.18.2. |
It still have the same problem. REPL Logs |
Issue seems to still exist. beomy's example replicates it nicely. Commenting in hopes of a re-open. |
Describe the bug
beforeUpdate
is called twice when usingbind:this
to the same variable in logic blocks. Even thoughafterUpdate
is schedule to be called after the lastbeforeUpdate
it isn'tUPDATE: Exists even if bound to two different variables
Logs
REPL log
To Reproduce
https://svelte.dev/repl/d85b4344f4044c4489b4e0260eabf475?version=3.6.8 (same variables)
https://svelte.dev/repl/7b1deb63003544358a6c4ee10ae28dcf?version=3.6.8 (different variables)
Expected behavior
If a single cycle isn't achieved, it should complete the cycle
Stacktraces
Stack trace
Information about your Svelte project:
Your browser and the version: Firefox 67
Your operating system: Ubuntu 18 LTS
Svelte version 3.6.8
Rollup
Severity
Severity is High, as the the cycle should always end with an
afterUpdate
and notbeforeUpdate
The text was updated successfully, but these errors were encountered: