Metadata for rooms
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 63.2k
- Forks
- 10.3k
- Avg merge
- 11d 20h
- Merged PRs (30d)
- 2
Description
Feature Request
Add metadata to rooms in the same manner that socket.data functions.
Purpose
I want to add some data related to the status/features of a room.
I'm creating rooms where one socket is the "owner" of the room, however that user might change, they might reconnect/disconnect. Logically it is better to separate that logic and apply it to the room itself rather than a socket within the room.
Concept
const rooms = io.of("/").adapter.rooms;
const myRoom = rooms.find((room) => {
return room.data.customVariable = "myCustomValue";
});
console.log(`you've just found your specialRoom ${myRoom}`);
Would also need to be able to set data to it in the same manner we can define socket.data.whatever = {}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the adapter.rooms entry point and the socket.data API mentioned in the request. Determine how room metadata should be stored, accessed, and handled as rooms are created or removed; done means the behavior and public API are defined and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100