question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Match-maker: RoomListingData returns wrong number of clients after client reconnect

See original GitHub issue

After implementing client reconnect, I noticed that the connections count in the Colyseus monitor is wrong after a client successfully reconnected to a room. For each successful reconnect, the connection count is decremented by one. Reconnecting multiple times can result in negative connection counts. Inspecting the room yields the correct connection count.

Digging through the code showed me that the endpoint simply displays the match-maker query. So I suspect a bug in the match.-maker itself.

Steps to Reproduce

  1. Connect to a room and go to the Colyseus Monitor: “1 Connection”
  2. Client loses connection and successfully reconnects using client.reconnect()
  3. Go to Colyseus Monitor again: “0 Connections” but the room still exists
  4. Click on the room: “1 Connection” (which is correct)

Colyseus Monitor

Context

Trying to implement client reconnect with the standard procedure as stated in the docs.

Your Environment

  • Colyseus Version: 0.14.20
  • Colyseus.js Version: 0.14.13
  • Colyseus Monitor Version: 0.14.20
  • Node.js Version: 14.15.3
  • Operating System and version: Linux Mint 20.2 (Kernel 5.8.0)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
CookedAppscommented, Sep 14, 2021

@lpsandaruwan Interesting. We do it like in your first example. That explains it.

1reaction
endelcommented, Sep 8, 2021

Thanks for looking into this @lpsandaruwan

Maybe this behaviour happens on the same scenario as https://github.com/colyseus/colyseus/issues/348#issuecomment-913933140

Read more comments on GitHub >

github_iconTop Results From Across the Web

Room - Colyseus & Arena Cloud Documentation
If onAuth() returns a falsy value, the client is immediatelly rejected, causing the matchmaking function call from the client-side to fail.
Read more >
Issues · colyseus/colyseus · GitHub
Server does not sync state with clients on the latest version ... Match-maker: RoomListingData returns wrong number of clients after client reconnect bug....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found