Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Don't throw in the server on certain unsub messages #54

Merged
merged 1 commit into from
Jan 10, 2017

Conversation

glasser
Copy link
Member

@glasser glasser commented Dec 22, 2016

To use an object as a map with arbitrary keys, you should either use
Object.create(null) or the Map class. Otherwise you can run into trouble
where keys like toString and constructor are in your app too. If the server
received such a message, an exception would get thrown within
SubscriptionManager.unsubscribe.

Noticed while reviewing @Urigo 's PR

@glasser glasser requested a review from stubailo December 22, 2016 23:07
To use an object as a map with arbitrary keys, you should either use
`Object.create(null)` or the `Map` class.  Otherwise you can run into trouble
where keys like `toString` and `constructor` are in your app too.  If the server
received such a message, an exception would get thrown within
SubscriptionManager.unsubscribe.
@glasser glasser force-pushed the glasser/safer-unsub branch from 86dcc9b to ac56986 Compare December 22, 2016 23:56
@helfer
Copy link
Contributor

helfer commented Jan 10, 2017

Thanks @glasser!

@helfer helfer merged commit 4629253 into master Jan 10, 2017
@dotansimha dotansimha deleted the glasser/safer-unsub branch June 12, 2017 08:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants