[y-partyserver] Awareness state is not sent to a client that joins an occupied room
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- distributed-systems
Direzione di ricerca
Inizia tracciando la gestione delle connessioni e del relay di awareness di YServer, quindi confronta il comportamento di join con il server di riferimento di y-websocket. Riproduci il problema con due client usando disableBc: true e verifica che il client che si connette successivamente riceva gli stati di awareness dei client esistenti immediatamente dopo la connessione; lo stato di presenza non dovrebbe più dipendere da un broadcast di awareness successivo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
When a client connects to a YServer room that already has other clients in it, the
newcomer receives the document state but never the awareness state of the
clients that were already connected. It only learns about them once one of them
happens to broadcast an awareness update.
The reverse direction works: the clients that were already connected do receive the
newcomer's awareness as soon as it joins.
The practical symptom is that a presence UI (avatars, remote carets) is empty for
whoever joins last, while everyone else can see them.
Expected
On connect, the server sends the current awareness states of the room to the new
connection, as y-websocket's reference server does — otherwise presence is only
eventually consistent, and only if someone moves.
Reproduction
YServerroom with two browser clients,disableBc: trueon both so only the
server relays (with BroadcastChannel on, same-browser tabs mask the problem).- Client A connects and calls
awareness.setLocalStateField('user', { … }). - Client B connects some seconds later and does the same.
// Client B, after `status === 'connected'` and after the document has synced:
provider.awareness.getStates()
// → only B's own client id. A is missing.
// Client A at the same moment:
provider.awareness.getStates()
// → both A and B.
Evidence it is specific to awareness
On client B the connection is up and the document arrives over that same socket —
the editor renders the room's content — so this is not a connection or auth problem.
It is only the awareness state that is not replayed.
Workaround
Have each client re-broadcast its own awareness whenever it notices a client id it
has not seen before. It settles after one round, but it means every client needs
this, and presence is briefly wrong before it does.
if (someClientIdIsNew) provider.awareness.setLocalStateField('user', me)
Versions
y-partyserver2.2.0partyserver0.5.10yjs13.6.32- Durable Objects, SQLite storage,
hibernate: true,workerd1.20260826.1
- Lingua principale
- TypeScript
- Stelle
- 1.3k
- Fork
- 84
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la 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 cloudflare/partykit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
cloudflare/partykit#425 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/partykit#424 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/partykit#423 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
cloudflare/partykit#419 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
cloudflare/partykit#411 ·
Tutte le issue di cloudflare/partykit
Issue simili
-
Add: Class TV ModaApertacheck:passed streams:add
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
GiganticMinecraft/seichi-playguide#183 ·
I maintainer di solito rispondono entro 1 giorno
-
area: core complexity: easy impact: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
ueberdosis/tiptap#8668 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
longbridge/nsh#804 ·
I maintainer di solito rispondono entro 1 giorno