Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
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.
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