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

Calling .leave request when unsubscribing #180

Merged
merged 3 commits into from
Jun 18, 2024
Merged

Calling .leave request when unsubscribing #180

merged 3 commits into from
Jun 18, 2024

Conversation

jguz-pubnub
Copy link
Contributor

@jguz-pubnub jguz-pubnub commented Jun 17, 2024

fix(presence): calling .leave request in missing cases

@jguz-pubnub jguz-pubnub changed the title Calling .leave request after unsubscribing Calling .leave request when unsubscribing Jun 17, 2024
Copy link
Contributor

@parfeon parfeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

case .heartbeatSuccess:
return state is Presence.Heartbeating
case .heartbeatFailed:
return state is Presence.Heartbeating
case .timesUp:
return state is Presence.HeartbeatCooldown
case .leftAll:
return !(state is Presence.HeartbeatInactive)
return true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we want to transit even if heartbeat loop is not active?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. You're right, the heartbeat loop is inactive if the user subscribes to some channel without Presence. However, we still have to trigger .leave invocation as a part of the unsubscribe cleanup

@jguz-pubnub
Copy link
Contributor Author

@pubnub-release-bot release as 7.3.1

@jguz-pubnub jguz-pubnub merged commit 9868745 into master Jun 18, 2024
10 checks passed
@jguz-pubnub jguz-pubnub deleted the fix/presence branch June 18, 2024 10:10
@pubnub-release-bot
Copy link

🚀 Release successfully completed 🚀

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

Successfully merging this pull request may close these issues.

3 participants