fix: unable to quit application with application exit or in-game exit button [MTT-7003]#863
Merged
fernando-cortez merged 5 commits intodevelopfrom Aug 31, 2023
Merged
Conversation
Contributor
|
On the open question: the refactoring looks good too. Based on the snippet it doesn't even seem like the current implementation uses the results, it just awaits for the call. |
LPLafontaineB
previously approved these changes
Aug 22, 2023
Contributor
LPLafontaineB
left a comment
There was a problem hiding this comment.
Approved! And nice catch for the lobby reset! I'll include that change in PR #860
86b4277
LPLafontaineB
previously approved these changes
Aug 31, 2023
LPLafontaineB
approved these changes
Aug 31, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR fixes the issue of not being able to quit the application after a game session.
This was due to not unsubscribing to the Application.wantsToQuit callback when attempting to quit. The callback would fire on a client when quitting, and in the attempt of quitting, would invoke
m_LobbyServiceFacade.EndTracking(), that call would return an error, the application would invoke Application.Quit, and the loop would continue, stuck in a loop.This PR simply unsubscribes to the Application.wantsToQuit callback when attempting to quit, invoking the cleanup coroutine only once.
Issue Number(s)
MTT-7003
How To Test
Contribution checklist
Open Question
This is more of a design question, but I'm noticing that on certain async Lobby requests, namely ones for deletion and leaving, the internal Lobby reference isn't cleared if the operation fails. This can happen if a client has been removed from a Lobby -> they try to leave that Lobby -> the Lobby doesn't exist -> async operation fails -> ResetLobby() is not invoked because of this.
So then the client is technically not part of a Lobby, but LobbyServiceFacade.CurrentUnityLobby is still not null. This can result in various attempts to leave a lobby when the application is quit, since LobbyServiceFacade.CurrentUnityLobby is not cleared.
I propose to refactor LobbyServiceFacade.LeaveLobbyAsync from:
to something like:
so that the Lobby is cleared regardless of async operation result.
Let me know your thoughts on this proposal. It would similarly be applied to the deletion async operation.