Real-time co-editing: presence and selection events for admins over Mercure
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- api, backend, distributed-systems
Hướng nghiên cứu
Start by reading MercureResourcePublisher and PublishableAwareHub, then trace how the subscriber cookie and private draft updates are created. Check whether draft updates arrive during the module's save behavior, which the payload does not specify. Define and implement the admin presence events, expiry or heartbeat, and rate limits; confirm subscribers are limited to admins and presence works across PHP pods. The linked pull request #560 is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Editors working on the same site at once should see each other: who is editing, which component they've selected, and their changes as they make them. Mercure is already CWA's real-time hub, and the bundle already publishes every write, with a private ?draft=1 update for admins (MercureResourcePublisher, PublishableAwareHub). So co-editing needs a few new events over the same hub, not a new transport.
Companion issues: the module side and the template's TipTap example (linked below once filed).
What the bundle would add
-
Presence events for admins. An endpoint an admin's browser calls to say what they're doing, published as a private update that only admins can receive:
- joined or left a page (route or page IRI);
- selected or deselected a component (component IRI, plus the position IRI so the same component in two places is told apart);
- started or stopped editing a component.
The payload carries the user's id and display name (username, or a name field if the app has one), never the email address.
-
A topic that only admins can subscribe to, using the subscriber cookie the bundle already sets at sign-in and refresh (the JWT
mercure.subscribeclaim). Visitors must never receive presence events. -
Leaving without saying so. A heartbeat, or an expiry on each presence event, so a closed tab or a lost connection drops that editor after a short time.
-
Draft changes as they're saved. Admin edits already save as drafts, and each save already publishes the private draft update. Check that this is enough for another admin's screen to follow along, including while a component is being typed into. If the module saves on a debounce, say what the delay is, so the module can show changes at a sensible rate.
Questions
- Should presence be stored at all (for a "who's here" list on first load), or only published? Publishing only is simpler; a late joiner would see others after their next event or heartbeat.
- Rate limits on the presence endpoint, so a stuck client can't flood the hub.
- Scaled mode: Mercure is one hub (standalone in scaled mode), so presence should work across php pods without anything shared beyond the hub. Confirm.
Out of scope
Two people typing in the same field at the same moment (character-level merging, such as Yjs). The first version can show who's editing and lock or warn on the component someone else is editing.
- Ngôn ngữ chính
- PHP
- Star
- 32
- Fork
- 8
- Merge trung bình
- 1 giờ 1 phút
- Pull request đã merge (30 ngày)
- 193
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 components-web-app/api-components-bundle
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
components-web-app/api-components-bundle#556 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
components-web-app/api-components-bundle#333 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
components-web-app/api-components-bundle#325 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
components-web-app/api-components-bundle#259 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
components-web-app/api-components-bundle#186 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của components-web-app/api-components-bundle
Issue tương tự
-
0.kind: enhancement 9.needs: package (update)
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
NixOS/nixpkgs#577156 · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
MagnaCapax/PMSS#1142 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Native-arrow select renders a second Jetpack chevronCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Automattic/static-site-importer#2294 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug 🐛
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
netalertx/NetAlertX#1856 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug Status: Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày