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

Update DdpAccount.cs #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

majumdarsr
Copy link

Pull request to Tom Bruckner’s fork of unity3d-DDP-Client:

Hi there,

This pull request is being submitted in response to github issue #11450 posted on meteor API repository. Also see here

This pull request addresses this issue (in @derwaldgeist’s own words): " ...We also noticed that if we do call logout immediately before the login, the Meteor server won't always remove the login token from the database as it normally would..."

We figured that there are three possible reasons why the token may sometimes remain in the database of client server.

  1. In case of Ddperror not being null, the tokens are not going to be deleted by HandleLogoutResult. Our proposed fix suggests that during ‘logout’ call the Ddperror throws warning to clients, asking them to retry logout.

  2. Meteor's ‘logout' call first deletes the tokens and then calls other methods or ‘callback’ for running in Fibers. Our proposed fix suggests that unity3d-DDP-Client also deletes the tokens before starting to WaitForResult.

  3. At logout, OnWebSocketClose process starts in main thread, and runs until finish OR until another process launches from RunInMainThreadAfter thread, depending on whether the time difference between OnWebSocketClose and RunInMainThreadAfter process is greater than the hard-coded delay value passed to RunAfter. The delay value needs to be sufficiently large to make sure that the ‘logout’ related processes finish before ‘login’ is called. We consulted meteor’s tested wait times before coming up with this suggestion.

Path: unity3d-ddp-client/unityproject/Assets/Moulin/DDP/account/DdpAccount.cs

Updating logout method, so that it handles Ddperror and removes token before waiting to receive 'result' message from the server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant