question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Store updates break transitions and components

See original GitHub issue

Describe the bug Components with an out:[transition] and a store subscription don’t get destroyed if the store is updated while out:[transition] is in progress.

To Reproduce https://svelte.dev/repl/00d38994d0364ea3a3ae629937142ea6?version=3.12.1

  1. Create a store
  2. Subscribe to it in component A
  3. Create an element with out:fade in component A
  4. Destroy component A and trigger a store update before the animation has completed Result: component A never got destroyed.

Expected behavior Components should be destroyed

Severity Very. It breaks apps without a single warning or error. This means that the more complex/nested your app is, the harder it is to troubleshoot.

Additional context Any app that relies on URL params to update the store is highly susceptible to this bug. I ran into it with Sapper as well.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

8reactions
jhwheelercommented, Aug 17, 2020

Fixed in 3.21.0 - https://svelte.dev/repl/00d38994d0364ea3a3ae629937142ea6?version=3.21.0

not really fixed, if the duration of transition for out:send is more than 100ms it will likely to stuck again, if duration is 600ms or 1000ms… it will surely stuck.

I can confirm this is still an issue as described, except the threshold I found was 240ms. Anything above that and this bug occurs; 240ms or below, it works as expected.

Here you can see an example REPL: https://svelte.dev/repl/c2ec0888fcf044f78b0ab05c446d5787?version=3.24.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

9. Updates, Transitions, and Motion - Interactive Data ...
Chapter 9. Updates, Transitions, and Motion Until this point, we have used only static datasets. But real-world data almost always changes over time....
Read more >
How to prevent shared state in a parent component from ...
Unfortunately, whenever the state in the parent element is changed, i.e. the button is clicked and the state is updated, the CSS updates...
Read more >
React 18 : Concurrency, Automatic Batching, Transitions & ...
React has always used batching for grouping state updates using event handlers and inbuilt hooks. Doing so helps prevent components from ...
Read more >
What's New in React 18 Alpha? Concurrency, Batching, ...
Updates wrapped in startTransition are marked as non-urgent and are interrupted if more urgent updates like clicks or key presses come in. If...
Read more >
Add, change, or remove transitions between slides
A transition determines how a slide enters, and how the previous slide exits. So if (for example) you didn't want a transition effect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found