Skip to content

[Bug]: onJoin with invalid room ID throws 4213 unhandled exception when run with Redis presence #608

@CookedApps

Description

@CookedApps

Context

No response

Bug description

After upgrading to colyseus/core 0.15.6 on our game server, joining a room by ID - where the ID is invalid (not malformed but e.g. because the room doesn't exist anymore) - the server throws returns error code 4213 MATCHMAKE_UNHANDLED an "generic exception during onCreate/onJoin". Instead, it should return error 4212 MATCHMAKE_INVALID_ROOM_ID as expected and as before.

Furthermore, the client receives the following response from the server:

{"code":4213,"error":"Cannot read properties of null (reading 'createdAt')"}

I am not able to reproduce this error locally without having Redis set up. It only happens when using colyseus with Redis. Therefore, it could be related to that (I guess).

Reproduction

No response

Steps to reproduce

  1. Start a Redis instance locally
  2. Start the game server with that Redis presence connected
  3. Try to join a room whose ID does not exist
  4. Receive unhandled exception

Environment & Versions

TypeScript version: 5.1.6
Node.js version: 18.16.0

Colyseus versions (server):
@colyseus/core: 0.15.6
@colyseus/monitor: 0.15.1
@colyseus/redis-driver: 0.15.1
@colyseus/redis-presence: 0.15.1
@colyseus/schema: 2.0.11
@colyseus/ws-transport: 0.15.1

Colyseus version (client):
colyseus.js: 0.15.11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions