[2.x] Realtime: rethink guest connections (connection cap, an off switch, scoped live updates)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue nà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
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, laravel, php
- Lĩnh vực
- api, backend, performance
Hướng nghiên cứu
Read the linked issues #5154 and #5155 and trace Manager::subscribeToChannel(), Websocket::onOpen(), and the forum JavaScript check for websocket.disallow_connection. Map how guest subscriptions, connection caps, and public payloads currently work before estimating the proposed changes. Done means guest and member caps are separate, guest connections can be disabled server-side, guest updates are scoped to discussions, and realtime payloads omit the discussion posts id list.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follows on from #5154 / #5155.
Today
- Every guest page view opens a websocket and subscribes to
public. publicis forum-wide. Anything sent there goes to every connected guest, as the full API document rendered for a guest. For a reply that is 10–50 KB, and it grows with the thread because the discussion half lists every post id. Today only discussion events reach it (started, renamed, hidden/restored, sticky, lock, tags). Post events never did (#5154).- Guests count towards
max-connections(default 1,000).Manager::subscribeToChannel()counts every subscribed socket, andWebsocket::onOpen()refuses new connections once the cap is reached, before it knows who is connecting. So guests can fill the cap and lock members out of realtime. - Admins can't turn guest connections off. The forum JS checks
websocket.disallow_connection, but the server never sends it.
Why it matters
The websocket server is one PHP process. It sends one uncompressed copy of each public payload to each guest connection. On forums with hundreds or thousands of connected users, putting replies, edits, likes and reactions on public (as #5155 first proposed) would multiply what it sends several times over.
Proposal
- Connection cap. Count guest and member connections separately, so guests can never lock members out.
- An off switch. A server-side setting for guest connections, sent to the forum so the existing client check works. When it's off, the server also skips rendering
publicpayloads. - Scoped live updates for guests.
publiccarries only small events (ids, the last post number), never full documents.- A guest reading a discussion subscribes to a channel for that discussion (e.g.
public-discussion=ID) and leaves it when they navigate away. The server renders the guest payload once per event and sends it only there. - The index shows "new activity" from the small event, and fetches the discussions when the reader releases them.
- Leaner payloads for everyone. Drop the discussion's
postsid list from realtime payloads. Clients re-fetch the discussion when an event arrives anyway.
Member delivery (a payload per member on their own channel) isn't part of this. The member-side visibility fix stays in #5155.
- Ngôn ngữ chính
- PHP
- Star
- 6.8k
- Fork
- 891
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 209
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 flarum/framework
-
type/accessibility type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Default language is ignored for anyone who chose a language, when the language selector is hiddenCó thể đã có người làm @1AbdullahButt đã nhận 15 ngày trước. Đang mởtype/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[2.x] False CLI/Web PHP mismatch when /usr/bin/php differs from the site's FPMCó thể đã có người làm @lazerg đã nhận 15 ngày trước. Đang mởtype/bug
Độ 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
-
Độ 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
-
[2.x] A filter on a resource without a searcher returns a 500Có thể đã có người làm @imorland đã nhận hôm nay. Đang mởtype/bug
flarum/framework#5578 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của flarum/framework
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 87/100
Sylius/Sylius#19359 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add php 8.6Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 66/100
mailersend/mailersend-php#199 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Tool: somcp_delete_currencyĐang mởConfiguration new tool
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
novalo-dev/Prestashop-MCP-Server#366 ·
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 62/100
Maintainer thường phản hồi trong vòng 10 ngày