-
Notifications
You must be signed in to change notification settings - Fork 402
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
Support for subscription with presence channels #393
Conversation
channels.forEach((c) => { | ||
const subscription = this.pubnub.channel(c).subscription(this.options); | ||
this.channelNames = [...this.channelNames, ...subscription.channels]; | ||
this.subscriptionList.push(subscription); | ||
}); | ||
channelGroups.forEach((cg) => { | ||
const subscription = this.pubnub.channelGroup(cg).subscription(this.options); | ||
this.groupNames = [...this.groupNames, ...subscription.channelGroups]; | ||
this.subscriptionList.push(subscription); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this cause trouble? Subscription
object will give regular and -pnpres
channels if it will be required by options.
I would expect that the required set of channels / groups (with presence channels) will be stored in channelNames
and groupName
when the filter will be back. Or it didn't work as expected with filter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now channelNames, groupNames have all required channels and groups.
When filter will be back then -pnpres channels will be filtered out and the same backward compatibility issue will arise.
It will be problem if User provides -pnpres
channel names along with receivePresenceEvents: true
And so we do not recommend it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, we may end up with a pretty bad situation. If people use a new approach, should we ask them not to set presence channels directly? On the other hand, sometime it is the only way to subscribe only to presence events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we ask them not to set presence channels directly?
That was the intention with current implementation. That user should not be worried about appending suffix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, sometime it is the only way to subscribe only to presence events.
Need to figure out the use case for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Signed-off-by: Serhii Mamontov <[email protected]>
@pubnub-release-bot release |
🚀 Release successfully completed 🚀 |
fix: fix issue with unsubscribe call when presence channels included manually.
Resolves the issue of manually included presence channels not being unsubscribed from the subscription set.
Closes #390