atom-archive / xray

An experimental next-generation Electron-based text editor
MIT License
8.47k stars 237 forks source link

Error polling incoming connection: frame size too big #75

Open akosyakov opened 6 years ago

akosyakov commented 6 years ago

I am getting when trying out Xray in the browser:

Error sending message to client on TCP socket: Protocol wrong type for socket (os error 41)
Error polling incoming connection: frame size too big
Error polling incoming connection: frame size too big
Error sending message to client on TCP socket: Broken pipe (os error 32)
Error polling incoming connection: frame size too big

Also some keys don't seem to work, e.g. i cannot enter a new line.

as-cii commented 6 years ago

Hello @akosyakov, and thanks for the report. We are aware of this issue and it is being caused by sending too much data on the TCP socket. Last time we saw this, it was related to sending the whole directory structure of a massive repository to the connecting client.

There are a couple of things that we could do to mitigate this:

  1. Increase the frame size via codec::length_delimited::Builder::max_frame_length. TCP may have some issues with handling frames that are larger than 64kb though.
  2. Split outgoing data into frames that are smaller than the maximum size and then re-assemble them when receiving them on the client. I think this would require writing our own codec, but should be pretty straightforward.
  3. Switch to a streamed representation for in-memory trees. In particular, one might argue that the current frame size cap is good also from a UX perspective: ideally, we would like users to start using xray without waiting to download the entire tree structure of the remote workspace. Thus, one thought could be to send tree nodes to remote clients in a depth-first (or breadth-first maybe?) fashion, as opposed to as a single huge payload.

As mentioned in last week's update, this week we are going to present a demo to some colleagues here at GitHub. As such, I don't think we are going to work on this bug before the end of the week. This is on our radar though and it will definitely be addressed at some point.

/cc: @nathansobo

maxbrunsfeld commented 6 years ago

Also some keys don't seem to work, e.g. i cannot enter a new line.

I think this particular key binding has been added on master.