Closed as not planned
Description
Describe the bug
If a subscriber of any store from svelte/store
throws an error, all stores immediately stop working – even if they're in an entirely different component.
This is because the subscriber_queue
doesn't get cleared, but new subscribers are, for some bizarre reason, called only if the queue is empty.
Reproduction
For a detailed look, go to this REPL and follow instructions therein.
However the basic idea can be understood from the following code:
import { writable } from 'svelte/store';
let a = writable(1);
let b = writable(1);
a.subscribe(x => { if (x > 1) throw new Error(); });
try { a.set(42); } catch {}
b.set(2); // doesn't update
Logs
No response
System Info
Browsers:
Brave Browser: 101.1.38.119
Packages:
svelte: 3.48.0
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels