[Bug]: sharded pubsub uses wrong channel after joining a room with namespace
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- redis, typescript
- Ambito
- distributed-systems
Direzione di ricerca
Inspect lib/util.ts around SPUBLISH and SSUBSCRIBE, then reproduce the namespace-and-room scenario described in the issue. Compare the Redis channels used after joining the room and when emitting to the socket; done means the emitted response uses the appropriate channel and is received by the client.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have multiple socket io namespaces.
on client joins a specific namespace, the client will join a room under the namespace, after that server will send the client a message. Code:
ns!.on("connection", async (socket) => {
console.log("A client connected!", socket.id);
socket.join('Room 1')
ns!.to(socket.id).emit("join_room_resp", {
response: `Joined Room 1 successfully!`,
});
});
Then I put some console.log in Redis adapter util under SPUBLISH and SSUBSCRIBE
export function SSUBSCRIBE(
redisClient: any,
channel: string,
handler: (rawMessage: Buffer, channel: Buffer) => void
) {
console.log(`>>>>>>SSUBSCRIBE ${channel}`);
// ....
}
export function SPUBLISH(
redisClient: any,
channel: string,
payload: string | Uint8Array
) {
console.log(`SPUBLISH ${channel} ${payload}`);
// ....
}
Output shows:
>>>>>>SSUBSCRIBE test.socket.io#/adasd#Room 1#
SPUBLISH test.socket.io#/adasd# {"type":3,"data":{"packet":{"type":2,"data":["join_room_resp",{"status":1,"room":"Room 1","response":"Joined Room 1 successfully!"}]},"opts":{"rooms":["x0jrTAQqgtKi7KDmAAAB"],"except":[],"flags":{}}},"uid":"19183eaa9eddca93","nsp":"/adasd"}
as shown above, after the user joins the channel, it subscribes Redis at channel test.socket.io#/adasd#Room 1#, but the message after that is published to channel test.socket.io#/adasd# which is wrong, and it lead to message never gets received
- Lingua principale
- TypeScript
- Stelle
- 2.8k
- Fork
- 485
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di socketio/socket.io-redis-adapter
-
question
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
socketio/socket.io-redis-adapter#574 · 1 commento ·
-
io.fetchSockets() fails with createSentinelForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
socketio/socket.io-redis-adapter#573 · 1 commento ·
-
`hasBinary()` throws `RangeError: Maximum call stack size exceeded` on Mongoose documents, silently dropping events in sharded modeForse già presa @junsj119 l’ha presa 96 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
socketio/socket.io-redis-adapter#558 · 1 commento ·
Tutte le issue di socketio/socket.io-redis-adapter
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
g1331/phantom-circuit#93 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
compiler
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
HerringtonDarkholme/hd-lang#1699 ·
I maintainer di solito rispondono entro 1 giorno
-
account bug communication lecture
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno