-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
If any svelte store subscriber raises an un-handled exception, future calls to .set() on any store will not notify subscribers.
In file svelte/src/store/index.js:58 in function set():
At line 58 the run_queue flag is set to true if there are no pending entries in the subscription queue1. After the queue has finished running, the queue is emptied by calling subscriber_queue.length = 0 at line 67. In the event that an un-handled exception is raised from one of the subscribers, the function exits without clearing subscriber_queue. These dangling items cause the check on line 58 to always return false, preventing the dispatch loop from running until the page is reloaded.
Reproduction
https://svelte.dev/repl/7521a9a8fc53451bbc1b229eb50dd587?version=4.2.16
Logs
No response
System Info
System:
OS: Linux 6.8 Arch Linux
CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
Memory: 12.92 GB / 62.74 GB
Container: Yes
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.7.1 - /usr/bin/node
npm: 10.4.0 - ~/.npm/bin/npm
npmPackages:
svelte: ^4.0.5 => 4.2.16Severity
annoyance