[y-partyserver] Awareness state is not sent to a client that joins an occupied room
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- distributed-systems
Hướng nghiên cứu
Bắt đầu bằng cách lần theo cách YServer xử lý kết nối và relay awareness, sau đó so sánh hành vi join với server tham chiếu của y-websocket. Tái hiện vấn đề với hai client bằng cách sử dụng disableBc: true và xác minh rằng client kết nối sau nhận được các trạng thái awareness của những client hiện có ngay sau khi kết nối; trạng thái presence không còn được phụ thuộc vào một broadcast awareness diễn ra sau đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 1.3k
- Fork
- 84
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudflare/partykit
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
cloudflare/partykit#425 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/partykit#424 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/partykit#423 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudflare/partykit#419 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
cloudflare/partykit#411 ·
Tất cả issue của cloudflare/partykit
Issue tương tự
-
docker infra P1 security size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
josephfung/curia#2408 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ehmpathy/rhachet-roles-ehmpathy#1231 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue help wanted
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 70/100
danielw-sudo/agentuto#32 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
nightgauge/nightgauge#2836 ·
Maintainer thường phản hồi trong vòng 1 ngày