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

cleanup called twice if there is an onUnsubscribe handler #283

Closed
lerouxb opened this issue May 27, 2019 · 0 comments
Closed

cleanup called twice if there is an onUnsubscribe handler #283

lerouxb opened this issue May 27, 2019 · 0 comments
Assignees
Labels
bug
Milestone

Comments

@lerouxb
Copy link

@lerouxb lerouxb commented May 27, 2019

nes/lib/listener.js

Lines 539 to 547 in 9f9f0c0

this._cleanup(socket, item);
if (this._settings.onUnsubscribe) {
for (let i = 0; i < item.paths.length; ++i) {
const itemPath = item.paths[i];
await this._remove(socket, itemPath, item.params[i]);
}
this._cleanup(socket, item);

Would probably be OK if the code was synchronous, but there's an await in between.

@hueniverse hueniverse self-assigned this May 30, 2019
@hueniverse hueniverse added the bug label May 30, 2019
@hueniverse hueniverse added this to the 11.2.0 milestone May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.