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

Svelte stores become stuck after unhandled exception in subscriber #11555

Open
nhhollander opened this issue May 11, 2024 · 0 comments
Open

Svelte stores become stuck after unhandled exception in subscriber #11555

nhhollander opened this issue May 11, 2024 · 0 comments

Comments

@nhhollander
Copy link

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.16

Severity

annoyance

Footnotes

  1. This behavior was first introduced in 46c9dbe4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant