Chat during match

Hello there, we are currently using nakama js, we would like to ask if it’s possible to join chat during a match?

Right now we are calling joinMatch and joinChat but it’s being disconnected on match whenever we do so.


Turns out when we use the joinChat here Nakama: Real-time Chat | Heroic Labs Documentation , nakama logs says “malformed payload”

nakama1  | {"level":"warn","ts":"2022-11-19T03:33:58.780Z","caller":"server/session_ws.go:239","msg":"Received malformed payload","uid":"828e6880-5d20-4601-ad7b-5133520fa2a9","sid":"ff93c29d-67ba-11ed-ac78-7106fdcb5b46","data":"eyJjaGFubmVsX2pvaW4iOnsidGFyZ2V0IjoxLCJ0eXBlIjoiR2xvYmFsQ2hhdCIsInBlcnNpc3RlbmNlIjpmYWxzZSwiaGlkZGVuIjpmYWxzZX0sImNpZCI6IjEifQ=="}

Nakama version: latest

Hello, are there any one experiencing this?

Seems like we’re on our own haha.
We’ve updated our sdk versions and also the server build, its still the same. I wonder why it is that when i’m on match and try to join chat, the socket disconnects.

It’s kind of sad that no one even dared to reply to my thread.
HAHAHA, anyways, we have finally solved the problem.

It turns out the documentation about joinChat is wrong

The image above says this code:

const response = await socket.joinChat(1, roomname, persistence, hidden);

But when we check the socket.ts in node_modules its actually goes like this:

async joinChat(target: string, type: number, persistence: boolean, hidden: boolean)

It means, it’s not working because the parameter arrangement of room name and type was swapped.

Hello @seiferxiii, apologies for the late response and thank you for reporting the issue, we’ve fixed the docs accordingly.

1 Like