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

#112 Added check to ensure we don't unsubscribe when disconnected #114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wolfenrain
Copy link

@wolfenrain wolfenrain commented Jul 12, 2018

Contributing checklist

  • Code must follow existing styling conventions
  • Added a descriptive commit message

Solves issue(s)

#112

Explanation

When disconnecting from session, there are still events being emitted, and depending on which one comes first, it will try to unsubscribe a subscriber while the Session doesn't know the subscriber. And that causes crashes.

I added a simple check to prevent that, it is a different boolean then the sessionConnected boolean because that one gets sets within those events, so it wouldnt have much influences. This way it does not break any of the current code. (also added a subscriberCollection.remove because otherwise it will try to remove subscriber that doesnt exist anymore)

@msach22
Copy link

msach22 commented Jan 14, 2019

@wolfenrain I'm happy to store a disconnected state, but we should use the events such as onConnected, onDisconnected, etc to know the state of the session. WDYT?

@mheap mheap changed the base branch from master to main March 22, 2021 09:50
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