Binary pushes don't work over the LongPoll transport
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- elixir, javascript
- 領域
- backend
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Elixir
- スター
- 23.2k
- フォーク
- 3.2k
- 平均マージ
- 16時間 35分
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
phoenixframework/phoenix のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
phoenixframework/phoenix#6898 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
~p treats routes as static when they only start with a static directory name対応中かも @mandar1045 が 12 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
phoenixframework/phoenix#6895 ·
メンテナーはふだん 1 日以内に返信
-
Connection: close header not sent before closing HTTP 1.1 connection when a controller raises an exception対応中かも @javiergarea が 41 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
phoenixframework/phoenix#6859 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
phoenixframework/phoenix#6853 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
LongPoll session tokens are not bound to the mount path or socket handler対応中かも @SteffenDE が 86 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
phoenixframework/phoenix#6791 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
phoenixframework/phoenix の issue をすべて見る
似ている issue
-
Bug: Table layout and date column are cut off on mobile screens on the Tournaments -> History pageオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
hexlet-codebattle/codebattle#2375 ·
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
wintermeyer/vutuv#2388 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
Broadcast API docs say to prepend realtime: to the topic, which breaks delivery対応中かも @mandar1045 が 1 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
phoenixframework/phoenix_live_view#4509 ·
メンテナーはふだん 1 日以内に返信