osu icon indicating copy to clipboard operation
osu copied to clipboard

Leaving a multiplayer room as the last user will sometimes still display the room in the lounge briefly

Open approachcircle opened this issue 4 years ago • 7 comments

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: osu_2021-01-20_03-32-52 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)

approachcircle avatar Jan 20 '21 03:01 approachcircle

same exception thrown by a similar cause on issue #11549

approachcircle avatar Jan 20 '21 03:01 approachcircle

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.

bdach avatar Jan 20 '21 19:01 bdach

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.

approachcircle avatar Jan 20 '21 19:01 approachcircle

As I said, this should be the case already.

bdach avatar Jan 20 '21 19:01 bdach

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

peppy avatar Jan 25 '21 08:01 peppy

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.

approachcircle avatar Aug 18 '22 00:08 approachcircle

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.

peppy avatar Aug 25 '22 05:08 peppy