Fix: Destroy completion is currently gated only by lobby leave, not party-network leave. - #95
Open
Maryam (maryammadzadeh) wants to merge 3 commits into
Conversation
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.
Session teardown is effectively a two-resource operation (Lobby + Party).
Previously, DestroySession completion was driven by lobby leave only. Because Party leave is asynchronous, OnDestroySessionComplete could fire before Party teardown actually finished. That created a race where subsequent Create/Join calls could fail due to lingering Party network state.
The fix gates destroy completion on both lobby leave and Party leave completion (when Party is active), so completion now reflects true teardown completion.
Update:
There was a deadlock risk whereDestroySession could wait forever for a Party-leave completion callback if the subsystem didn’t actually mark a leave as pending (for example, when already transitioning state). The fix adds a guard right after LeavePlayFabPartyNetwork() to detect that case, clear the leave delegate, and mark the party-leave gate complete immediately so TryCompletePendingDestroySession() can still finish.
Another issue was a second DestroySession call could overwrite Boolean pending state, so that second call needs to fail
This should probably be discussed