osu
osu copied to clipboard
Leaving a multiplayer room as the last user will sometimes still display the room in the lounge briefly
Describe the bug: I started a multiplayer room, submitted a score on a beatmap with no other players, left the room and the exception was thrown when I tried to rejoin the room before it had ended, and also after it had ended.
Screenshots or videos showing encountered issue:
Any error notifications were dismissed as I clicked the notification to open the log directory instead of opening it myself.
osu!lazer version: 2021.118.1
Logs: runtime.log
(Exception is thrown at 03:17:10)
same exception thrown by a similar cause on issue #11549
I have no access to server-side logs, but I'm relatively sure the room should have closed immediately after you left it. The likely reason for the apparent discrepancy is that rooms are being polled periodically, and you probably hit an interval between leaving the room and the lounge updating its listing, in which the data displayed was stale.
So the error is probably correct if the above is the case, and we probably should be immediately deleting the room from the lounge listing client-side if we know that the user was the last person in it.
on the room's closing time, it displayed a countdown (lasting about 8 seconds or so) before it would be marked as closed and I attempted to join before that countdown was over, not sure if the countdown was just stale data and was just leftover from leaving in between the polling interval as you said. it seems that it would make more sense for the server to try and automatically close the room due to it being empty though.
As I said, this should be the case already.
On leaving a multiplayer room, it is forcefully removed from the listing temporarily to avoid this kind of issue, but based on the timings of polls, you may still see the room briefly. I believe we may be able to handle this better (I recall @smoogipoo mentioning this as a todo item) so will leave this open to track the improvements here.
https://github.com/ppy/osu/blob/67b5ebadf5e2cb11b70e416e2ca4ef11697f8178/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerRoomManager.cs#L74-L80
i just wanted to add that if you are forcefully removed from a room because the host has ended it, the lounge listing will still display it as open, and will still throw an exception if it is attempted to join again. i'm not sure how easy it would be to just visually remove the room from the listing considering the client already is aware that the room has been closed since the client forcefully removed the player.
i am pretty sure that this is still within this issue's scope, considering the only difference is that the room isn't being made empty by the host leaving, but instead, the host is ending the room while players are still connected, and the lounge listing still displays the closed room in its incorrect state due to API polling timings.
i just wanted to add that if you are forcefully removed from a room because the host has ended it, the lounge listing will still display it as open, and will still throw an exception if it is attempted to join again. i'm not sure how easy it would be to just visually remove the room from the listing considering the client already is aware that the room has been closed since the client forcefully removed the player.
That definitely sounds like an edge case in the current workaround handling. Probably not worth fixing and instead implementing a better solution that doesn't require the workaround in the first place, though.