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

Unsubscribing last subscriber twice from a writable store runs null() #4931

Closed
pushkine opened this issue May 29, 2020 · 4 comments
Closed

Comments

@pushkine
Copy link
Contributor

https://svelte.dev/repl/fc33f2d0f07c43c0a90b5de49b267396?version=3.23.0

return () => {
const index = subscribers.indexOf(subscriber);
if (index !== -1) {
subscribers.splice(index, 1);
}
if (subscribers.length === 0) {
stop();
stop = null;
}
};

@Conduitry
Copy link
Member

Conduitry commented May 29, 2020

I don't know whether you intend this as a bug report, but I don't know that I'd call this a bug. I also don't know that I'd call this a particularly worthwhile feature request. People should probably be careful to only unsubscribe from a subscription once.

edit: Eh. If we're already otherwise allowing unsubscribers to be called multiple times (are we?) then also handling that here might make sense.

@dimfeld
Copy link
Contributor

dimfeld commented May 29, 2020

Someone in the discord yesterday was seeing a problem that I’m pretty sure was this issue, and he said he was only using autosubscription. I asked if he could put together a REPL but haven’t heard back yet (unless I missed it overnight).

@stale
Copy link

stale bot commented Dec 24, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Dec 24, 2021
@gtm-nayan
Copy link
Contributor

fixed by #8186

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

No branches or pull requests

6 participants