spacebarchat / server

Spacebar server - A reimplementation of the Discord.com backend, built with Typescript and love
https://spacebar.chat
GNU Affero General Public License v3.0
1.49k stars 250 forks source link

Session activities mismatch in READY #1091

Closed kozabrada123 closed 1 year ago

kozabrada123 commented 1 year ago

Describe the bug In the READY gateway event there's a sessions field. In each session object, there's an activities array.

When there are no activities, discord.com sends it as an empty array: {"activities":[]}

While on a spacebar server, it's sent as null: {"activities":null}

To Reproduce Capture the gateway traffic of discord.com and spacebar, then compare

(discord.com) "sessions":[{"status":"online","session_id":"REMOVED","client_info":{"version":0,"os":"windows","client":"web"},"activities":[]}]

(old.server.spacebar.chat) "sessions":[{"active":true,"activities":null,"client_info":{"os":"Windows","version":0},"session_id":"all","status":"online"}]

Expected behavior This field should likely be [] instead of null.

Instance Information: Found this while testing on wss://gateway.old.server.spacebar.chat

VIRAT9358 commented 1 year ago

Can you please provide the exact location of the code , I couldnt find it in gateway folder

Puyodead1 commented 1 year ago

Can you please provide the exact location of the code , I couldnt find it in gateway folder

Just search for it lol.

kozabrada123 commented 1 year ago

Can you please provide the exact location of the code , I couldnt find it in gateway folder

Sorry, I dont work on spacebar, I just found this as an end user

Puyodead1 commented 1 year ago

Can you please provide the exact location of the code , I couldnt find it in gateway folder

🙄 https://github.com/spacebarchat/server/blob/master/src/gateway/opcodes/Identify.ts#L392