Commit Graph
89 Commits
Author SHA1 Message Date
Nathan SoboandAntonio Scandurra 504a88d3ab Add integration test for dropping host connections while sharing
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-25 10:32:31 -06:00
Nathan SoboandAntonio Scandurra a22e44d86c Clear out project registration and sharing state on disconnect
Previously, we weren't fully clearing the state associated with projects and worktrees when losing connection. This caused us to not see guest avatars disappear and not be able to re-share upon reconnect.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-25 10:15:08 -06:00
Max Brunsfeld 76cf065588 Make UpdateBuffer a foreground message 2022-03-22 13:32:25 -07:00
Antonio Scandurra 8ac8e39983 Bump protocol version 2022-03-22 13:19:07 +01:00
Max BrunsfeldandAntonio Scandurra b781e2da67 Set up logic for starting following
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-17 10:46:54 -07:00
Antonio ScandurraandNathan Sobo 8392138618 Start defining follow protocol
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 16:50:29 +01:00
Antonio ScandurraandNathan Sobo 1816b44648 Fade out unnecessary code
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:51:59 +01:00
Max Brunsfeld 7b41e4f33c Bump protocol version number 2022-03-14 15:57:39 -07:00
Antonio Scandurra 7498e16311 Display language server name in status bar 2022-03-10 16:48:43 +01:00
Antonio Scandurra 212fb05f33 Listen to all LSP progress notifications and broadcast them to peers 2022-03-10 12:00:33 +01:00
Max BrunsfeldandKeith Simmons 51ba8f9846 Reset receive timeout only on reads from websocket connection, not writes
Also, increase the receive timeout to 30 seconds. We'll still respond immediately
to explicit disconnection, but when there are temporary network blips that
delay pings, we think we should err on the side of keeping the connection
alive. This is in response to a false positive 'host disconnected' state
that we observed when pairing today, while the host (Keith) still clearly
had a working internet connection, because we were screen sharing.

Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-09 11:27:47 -08:00
Antonio Scandurra f752458c55 Remove unused CloseBuffer message 2022-03-08 11:17:20 +01:00
a5c807cd7a Reset peer's receive timeout when a message is received
* Make advance_clock more realistic by waking timers in order,
  instead of all at once.
* Don't advance the clock when simulating random delays.

Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-07 15:33:43 -08:00
Antonio ScandurraandNathan Sobo 079a53cd59 WIP: Introduce a read timeout
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-07 17:08:12 +01:00
Max Brunsfeld 310269e0d6 Adjust test connection to treat the half-open state more realistically
When a network connection is lost without being explicitly closed by the
other end, writes to that connection will error, but reads will just wait
indefinitely.

This allows the tests to exercise our heartbeat logic.
2022-03-04 16:47:55 -08:00
b2112ad40e Send websocket pings from both the client and the server
Remove the client-only logic for sending protobuf pings.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-04 15:21:18 -08:00
b36faed34e Correctly defer undo operations when messages arrive out of order
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-03 18:07:59 +01:00
Antonio Scandurra 7470cadc51 Move code action and completion edit messages to the background 2022-03-03 13:54:26 +01:00
Antonio Scandurra e18e172cda Move several buffer-related messages to the background 2022-03-03 12:18:19 +01:00
5ca65a46c7 Move SearchProject to the background
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-02 14:38:16 -08:00
Antonio Scandurra 1a0afa9271 Bump protocol version 2022-03-02 15:08:33 +01:00
Max Brunsfeld 497ffb602d Avoid retaining executor when using Connection::in_memory 2022-03-01 18:02:12 -08:00
Max Brunsfeld 6cdc2f766d Handle Peer responses using a futures::oneshot instead of postage::mpsc 2022-03-01 13:37:33 -08:00
Antonio Scandurra 79568c471a Pass a reference to TestAppContext in tests
This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
2022-03-01 12:01:02 +01:00
Antonio ScandurraandNathan Sobo 294165e748 Make SearchProject a Foreground message
However, the randomized integration test is still failing:

```
ITERATIONS=100000 SEED=3027 OPERATIONS=200 cargo test --release test_random --package=zed-server -- --nocapture
```

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-28 16:19:34 +01:00
Max Brunsfeld 44feb71b99 Add project search RPC messages 2022-02-25 12:38:31 -08:00
Max Brunsfeld 043b45e9d4 Improve logging around handling RPC requests on client 2022-02-23 15:37:51 -08:00
ab28a5bb54 Remove ShareWorktree message
Instead, create an empty worktree on guests when a worktree is first *registered*, then update it via an initial UpdateWorktree message.

This prevents the host from referencing a worktree in definition RPC responses that hasn't yet been observed by the guest. We could have waited until the entire worktree was shared, but this could take a long time, so instead we create an empty one on guests and proceed from there.

We still have randomized test failures as of this commit:

SEED=9519 MAX_PEERS=2 ITERATIONS=10000 OPERATIONS=7 ct -p zed-server test_random_collaboration

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-23 11:56:09 -07:00
Antonio Scandurra 7a0e8560a3 WIP 2022-02-23 19:04:22 +01:00
Antonio Scandurra 02f215d953 Move document highlights RPC message to the background 2022-02-23 16:16:02 +01:00
Nathan Sobo 9c99b82bc4 Bump protocol version 2022-02-23 06:33:31 -07:00
Max Brunsfeld ba2aa6798f Show document highlights from the language server when moving the cursor 2022-02-22 17:16:31 -08:00
Max BrunsfeldandNathan Sobo c5888616cc Implement find-all-references
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-22 14:27:16 -08:00
Antonio Scandurra f8762ff1ce Allow opening of buffers associated with a project symbol 2022-02-22 16:26:01 +01:00
Antonio Scandurra 416898db0e Retrieve project symbols over RPC 2022-02-22 14:50:06 +01:00
Antonio Scandurra 3948b5da7f WIP: Start on getting project symbols over RPC 2022-02-22 12:15:38 +01:00
Antonio Scandurra 7a72d7aed7 Undo temporary edits before performing rename or canceling it
Also, wire up remote renames.
2022-02-18 11:41:47 +01:00
Max Brunsfeld a40938e1ca Start work on renames 2022-02-17 18:01:07 -08:00
Antonio ScandurraandNathan Sobo 960dff5dc9 Use the lowest zstd compression level during tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-17 15:16:51 +01:00
Max BrunsfeldandNathan Sobo 529e18978e Remove unnecessary waiting during completion RPC requests
Also, add completion requests to the randomized collaboration integration test,
to demonstrate that this is valid.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-16 17:23:16 -08:00
Max BrunsfeldandAntonio Scandurra 905c66d153 Restore synchronization between responses and incoming messages
This removes the need to buffer pending messages in Client.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-16 10:28:32 -08:00
Max BrunsfeldandAntonio Scandurra 07cf29887d Distinguish between "foreground" and "background" RPC messages
Some types of messages, which entail state updates on the host, should be
processed in the order that they were sent. Other types of messages should
not block the processing of other messages.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-16 10:01:23 -08:00
f9310dfcbb Add a Test message that we can use to assert on the behavior of Peer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-02-16 18:32:03 +01:00
Antonio Scandurra 611fd09c27 Ensure worktree updates are observed in order on the server 2022-02-16 14:05:10 +01:00
Max BrunsfeldandAntonio Scandurra a1d42938b6 Remove logic for preserving RPC message order between peers
* On the server, spawn a separate task for each incoming message
* In the peer, eliminate the barrier that was used to enforce ordering
  of responses with respect to other incoming messages

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-14 10:51:12 -08:00
Antonio Scandurra 04e0b7f5fc Add integration test for code actions 2022-02-14 11:42:56 +01:00
Antonio Scandurra 9579835699 Ensure response barrier is always dropped, even if request is canceled 2022-02-12 10:23:50 +01:00
Antonio Scandurra e035758ba9 Move Buffer::format to Project::format 2022-02-11 12:07:46 +01:00
Antonio Scandurra 83f6744174 Bump protocol version 2022-02-08 15:00:06 +01:00
Antonio Scandurra 943fb46052 Apply code actions remotely 2022-02-08 12:18:14 +01:00