zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.08k stars 3.07k forks source link

Can't open certain files during collaborative session #5659

Closed fdionisi closed 2 years ago

fdionisi commented 2 years ago

Check for existing issues

Describe the bug

As a guest in a collaborative session, I wasn't able to open all files in the workspace.

To reproduce

Not sure how to reproduce it... I didn't have a way to fully test it but:

  1. Join as guest
  2. Open a file
  3. CMD+Click to go to definition (won't work)
  4. Try to navigate to the definition file (through command palette or tree view)

Expected behavior

The file is open in the buffer

Environment

Zed 0.49.1 – /Applications/Zed.app macOS 12.1 architecture arm64

If applicable, add mockups / screenshots to help explain present your vision of the feature

https://user-images.githubusercontent.com/8927326/182865997-96403def-c5e9-4917-a2eb-56e7f50c0000.mp4

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue

Caused by: 0: IO error: Connection reset by peer (os error 54) 1: Connection reset by peer (os error 54) 06:03:23 [INFO] set status on client 0: ConnectionLost 06:03:23 [INFO] set status on client 0: Reauthenticating 06:03:23 [INFO] set status on client 0: Reconnecting 06:03:23 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc 06:03:24 [INFO] add connection to peer 06:03:24 [INFO] add_connection; 06:03:24 [INFO] set status to connected 98 06:03:24 [INFO] set status on client 0: Connected { connection_id: ConnectionId(98) } 06:18:59 [ERROR] connection error: error reading rpc message from socket

Caused by: 0: IO error: Connection reset by peer (os error 54) 1: Connection reset by peer (os error 54) 06:18:59 [INFO] set status on client 0: ConnectionLost 06:18:59 [INFO] set status on client 0: Reauthenticating 06:18:59 [INFO] set status on client 0: Reconnecting 06:19:00 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc 06:19:01 [INFO] add connection to peer 06:19:01 [INFO] add_connection; 06:19:01 [INFO] set status to connected 99 06:19:01 [INFO] set status on client 0: Connected { connection_id: ConnectionId(99) } 06:36:28 [ERROR] connection error: error reading rpc message from socket

Caused by: 0: IO error: Connection reset by peer (os error 54) 1: Connection reset by peer (os error 54) 06:36:28 [INFO] set status on client 0: ConnectionLost 06:36:28 [INFO] set status on client 0: Reauthenticating 06:36:28 [INFO] set status on client 0: Reconnecting 06:36:29 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc 06:36:30 [INFO] add connection to peer 06:36:30 [INFO] add_connection; 06:36:30 [INFO] set status to connected 100 06:36:30 [INFO] set status on client 0: Connected { connection_id: ConnectionId(100) } 06:47:11 [ERROR] connection error: delay between messages too long 06:47:11 [INFO] set status on client 0: ConnectionLost 06:47:11 [INFO] set status on client 0: Reauthenticating 06:47:11 [INFO] set status on client 0: Reconnecting 06:51:04 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc 06:51:05 [INFO] add connection to peer 06:51:05 [INFO] add_connection; 06:51:05 [INFO] set status to connected 101 06:51:05 [INFO] set status on client 0: Connected { connection_id: ConnectionId(101) } 07:07:00 [ERROR] connection error: error reading rpc message from socket

Caused by: 0: IO error: Connection reset by peer (os error 54) 1: Connection reset by peer (os error 54) 07:07:00 [INFO] set status on client 0: ConnectionLost 07:07:00 [INFO] set status on client 0: Reauthenticating 07:07:00 [INFO] set status on client 0: Reconnecting 07:07:01 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc 07:07:01 [INFO] add connection to peer 07:07:01 [INFO] add_connection; 07:07:01 [INFO] set status to connected 102 07:07:01 [INFO] set status on client 0: Connected { connection_id: ConnectionId(102) } 07:18:44 [ERROR] connection error: error reading rpc message from socket

Caused by: 0: IO error: Connection reset by peer (os error 54) 1: Connection reset by peer (os error 54) 07:18:45 [INFO] set status on client 0: ConnectionLost 07:18:45 [INFO] set status on client 0: Reauthenticating 07:18:45 [INFO] set status on client 0: Reconnecting 07:18:45 [INFO] connected to rpc endpoint https://collab.zed.dev/rpc 07:18:48 [INFO] add connection to peer 07:18:48 [INFO] add_connection; 07:18:48 [INFO] set status to connected 103 07:18:48 [INFO] set status on client 0: Connected { connection_id: ConnectionId(103) } 08:40:54 [INFO] open paths ["/Users/federico/Code/github.com/Think-iT-Labs/think-it-website"] 11:05:21 [INFO] open paths ["/Users/federico/Code/github.com/Think-iT-Labs/internal-edc-ui"] 11:05:26 [WARN] incoming response: unknown request connection_id=103 message_id=22 responding_to=536 11:06:31 [WARN] incoming response: unknown request connection_id=103 message_id=243 responding_to=573 11:10:53 [WARN] incoming response: unknown request connection_id=103 message_id=1038 responding_to=731 11:10:58 [WARN] incoming response: unknown request connection_id=103 message_id=1073 responding_to=744 11:24:35 [ERROR] error handling message. client_id:0, message_id:1032, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:24:38 [ERROR] error handling message. client_id:0, message_id:1049, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:24:38 [ERROR] error handling message. client_id:0, message_id:1050, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:24:52 [ERROR] error handling message. client_id:0, message_id:1067, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:24:52 [ERROR] error handling message. client_id:0, message_id:1068, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:24:52 [ERROR] error handling message. client_id:0, message_id:1069, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:24:52 [ERROR] error handling message. client_id:0, message_id:1078, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:24:52 [ERROR] error handling message. client_id:0, message_id:1079, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:24:52 [ERROR] error handling message. client_id:0, message_id:1080, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:25:04 [ERROR] error handling message. client_id:0, message_id:1088, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:25:04 [ERROR] error handling message. client_id:0, message_id:1089, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:25:04 [ERROR] error handling message. client_id:0, message_id:1090, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:25:39 [ERROR] error handling message. client_id:0, message_id:1126, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:25:39 [ERROR] error handling message. client_id:0, message_id:1128, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:25:39 [ERROR] error handling message. client_id:0, message_id:1129, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:26:47 [ERROR] error handling message. client_id:0, message_id:1154, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:26:47 [ERROR] error handling message. client_id:0, message_id:1157, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:26:47 [ERROR] error handling message. client_id:0, message_id:1158, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:26:49 [ERROR] error handling message. client_id:0, message_id:1167, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:26:49 [ERROR] error handling message. client_id:0, message_id:1170, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer 11:26:49 [ERROR] error handling message. client_id:0, message_id:1171, sender_id:Some(6808), type:UpdateBufferFile, error:no such buffer

as-cii commented 2 years ago

Thanks, @fdionisi! 💯

We couldn't reproduce this deterministically, but after spending some time analyzing the relevant code paths we found an interaction that could lead to this case. We just landed a fix for it on main and this defect should be resolved as part of the next release.

Please, feel free to re-open this if you are still able to reproduce it after v0.51.0 goes out. 🙏