Binary pushes don't work over the LongPoll transport
Maintainer thường phản hồi trong vòng 1 ngà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
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- elixir, javascript
- Lĩnh vực
- backend
Hướng nghiên cứu
Start with Phoenix.Transports.LongPoll.Server, where the {:push, ...} and {:reply, ...} clauses drop the frame opcode before buffering, and with the LongPoll client path in longpoll.js that parses the messages list. Run the LongPoll transport tests and add a case that pushes {:binary, <<255,1,2>>} then another message, checking the poll returns both without a 500 and the client parses them. Done means binary server-to-client frames round-trip over LongPoll as they do over WebSocket; note #6907 already proposes a base64 approach, so review it first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Pushing binary data from a channel doesn't work when the client is on the LongPoll transport.
def handle_info(:send_bin, socket) do
push(socket, "bin", {:binary, <<255, 1, 2>>})
{:noreply, socket}
end
Over WebSocket this works fine. Over LongPoll:
- if the data is not valid UTF-8, the poll request fails with a 500 (
{:invalid_byte, 255}from the JSON encoder), and since the server already cleared its buffer, every other buffered message in that poll is lost too (including the join reply in my test) - if the data happens to be valid UTF-8, the raw binary frame ends up as a string in the
messageslist, e.g."\u0000\u0001\u0006\u00031room:xbinhello", and phoenix.js fails trying toJSON.parseit
Looks like Phoenix.Transports.LongPoll.Server drops the opcode ({:push, {_, reply}, state} / {:reply, status, {_, reply}, state}) and buffers the binary as if it was text. Client to server binary over LongPoll is already handled (base64 encoded, from #5513), but the server to client direction isn't.
One option would be to base64 encode binary frames on the server like the upload path does, and have longpoll.js decode them before handing them to the socket.
- Ngôn ngữ chính
- Elixir
- Star
- 23.2k
- Fork
- 3.2k
- Merge trung bình
- 16 giờ 35 phút
- Pull request đã merge (30 ngày)
- 18
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 phoenixframework/phoenix
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
phoenixframework/phoenix#6898 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
~p treats routes as static when they only start with a static directory nameCó thể đã có người làm @mandar1045 đã nhận 12 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 30/100
phoenixframework/phoenix#6895 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Connection: close header not sent before closing HTTP 1.1 connection when a controller raises an exceptionCó thể đã có người làm @javiergarea đã nhận 41 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
phoenixframework/phoenix#6859 ·
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 55/100
phoenixframework/phoenix#6853 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LongPoll session tokens are not bound to the mount path or socket handlerCó thể đã có người làm @SteffenDE đã nhận 86 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
phoenixframework/phoenix#6791 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của phoenixframework/phoenix
Issue tương tự
-
Bug: Table layout and date column are cut off on mobile screens on the Tournaments -> History pageĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
hexlet-codebattle/codebattle#2375 ·
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
wintermeyer/vutuv#2388 ·
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 74/100
-
Broadcast API docs say to prepend realtime: to the topic, which breaks deliveryCó thể đã có người làm @mandar1045 đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/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 72/100
phoenixframework/phoenix_live_view#4509 ·
Maintainer thường phản hồi trong vòng 1 ngày