You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
socket.write returns the number of bytes written and doesn't buffer. That means if you write a large amount of data, the network might not send all of it, and you have to retry the unsent data when the drain callback is called. This buffering behavior is how it works in the system APIs on posix/windows.
This is very much a footgun, and we need to make this clearer in the documentation or have a way to buffer this automatically (outside of using node:net), because you're not the first person who thought this was a bug.
What version of Bun is running?
1.1.42+50eec0025
What platform is your computer?
MacOs 14.6.1 (23G93)
What steps can reproduce the bug?
I tried to narrow things down here: https://github.com/dlants/neovim-mini-repro
initially I thought the issue was on neovim's side, but I think it's in Bun.connect on the socket.
As the repo is configured, you can see that:
If you swap the script to node instead:
rm -rf node_modules
npm install
jobstart
for node and comment out thejobstart
for bunThen you can see the large file makes it into neovim.
I'd be happy to try and reduce it more, but I'm not super familiar with sockets so I'm not sure what to look for / what to sub out neovim for?
What is the expected behavior?
Should work the same in node and bun.
What do you see instead?
Works in node, does not work in bun.
Additional information
No response
The text was updated successfully, but these errors were encountered: