Skip to content

Fix: Destroy completion is currently gated only by lobby leave, not party-network leave. - #95

Open
Maryam (maryammadzadeh) wants to merge 3 commits into
PlayFab:mainfrom
maryammadzadeh:maryammadzadeh/gate-destroysession-on-party-leave
Open

Fix: Destroy completion is currently gated only by lobby leave, not party-network leave.#95
Maryam (maryammadzadeh) wants to merge 3 commits into
PlayFab:mainfrom
maryammadzadeh:maryammadzadeh/gate-destroysession-on-party-leave

Conversation

@maryammadzadeh

@maryammadzadeh Maryam (maryammadzadeh) commented Jun 25, 2026

Copy link
Copy Markdown

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

@maryammadzadeh Maryam (maryammadzadeh) changed the title PFOSS Session should be treated as Lobby + Party coupled, not “lobby-only.” Fix: Destroy completion is currently gated only by lobby leave, not party-network leave. Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant