Commit Graph
137 Commits
Author SHA1 Message Date
K Simmons 3dce18540e clippy fixes for focus change 2022-08-10 16:51:01 -07:00
ForLoveOfCatsandMikayla fbea44bc5c One big cleanup pass of clippy lints
Co-authored-by: Mikayla <mikayla@zed.dev>
2022-08-10 16:51:01 -07:00
Max Brunsfeld ac140c478e Handle RPC requests for type definitions on server and host 2022-08-04 15:10:46 -07:00
Antonio Scandurra e8850d498c Merge branch 'main' into user-timeline 2022-07-04 09:23:16 +02:00
Antonio Scandurra 08b828696a Ensure worktrees have been sent before responding with definitions
Changing the frequency at which we update worktrees highlighted a
problem in the randomized tests that was causing clients to receive
a definition to a worktree *before* observing the registration of
the worktree itself. This was most likely caused by #1224 because
the scenario that pull request enabled was the following:

- Guest requests a definition pointing to a non-existant worktree
- Server forwards the request to the host
- Host sends an `UpdateProject` message
- Host sends a response to the definition request
- Server observes the `UpdateProject` message and tries to acquire
  the store
- Given that we're waiting, the server goes ahead to process the
  response for the definition request, responding *before*
  `UpdateProject` is forwarded
- Server finally forwards `UpdateProject` to the guest

This commit ensures that, after forwarding a project request and getting a
response, we acquire a lock to the store again to ensure the project still
exists. This has the effect of ordering the forwarded request *after* any
message that was received prior to the response and for which we are still
waiting to acquire a lock to the store.
2022-07-01 11:45:30 +02:00
Antonio Scandurra c18607bf40 Split worktree updates when a peer joins an already-shared project 2022-06-30 16:49:56 +02:00
Antonio Scandurra f174a355bf Split worktree updates and only send 256 entries at a time 2022-06-30 14:06:41 +02:00
Antonio ScandurraandNathan Sobo 1ada2ebacb Record worktree extensions every 5 minutes
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-29 16:58:19 +02:00
Antonio Scandurra 2bff764afa Register project activity for offline projects as well 2022-06-29 14:55:04 +02:00
Max Brunsfeld 9d3cddede7 🎨 Tweak some names dealing with user activity
* Rename `project_activity_summary` to `top_users_activity_summary`
to make clearer the distinction between it and the per-user summary.
* Rename `user_activity_summary` to `user_activity_timeline`, since
its output is structured a bit differently than the courser-grained
"summary" returned by the top-user query.
* Rename `ActivityDuration` -> `ActivityPeriod`
2022-06-28 15:37:56 -07:00
Antonio Scandurra a4fc945cee Gather metrics only when /metrics endpoint is retrieved 2022-06-24 09:28:52 +02:00
Antonio Scandurra 4359c804ad Don't trace message payload 2022-06-24 09:27:22 +02:00
Antonio Scandurra 3f0cfb4ae6 Use a FuturesUnordered to process foreground messages
This prevents deadlocks when e.g., client A performs a request to client B and
client B performs a request to client A. If both clients stop processing further
messages until their respective request completes, they won't have a chance to
respond to the other client's request and cause a deadlock.

This arrangement ensures we will attempt to process earlier messages first, but fall
back to processing messages arrived later in the spirit of making progress.
2022-06-22 15:04:17 +02:00
Antonio Scandurra 0f30de23aa Exclude staff from activity recording 2022-06-21 16:07:59 +02:00
Antonio Scandurra 7eb672c1e4 Unregister project from db when user disconnects or manually does so 2022-06-21 10:37:34 +02:00
Antonio Scandurra 12b3138de1 Register projects in the database and record worktree extensions 2022-06-21 10:29:26 +02:00
Max Brunsfeld 46d614d62f Add an API that returns the most active users and the projects where they've been active 2022-06-20 19:46:37 -07:00
Antonio Scandurra 21c730dd79 Fix tests 2022-06-15 11:16:26 +02:00
Antonio Scandurra 33c902540b Harvest the latest metrics when /metrics is requested
Now that we track active projects, if nothing happens to the store
during the activity timeout we would still serve some old metrics
that may not account for the staleness of a project.

This commit changes it so that we grab a mutable reference to the store
before serving the metrics, which has the side effect of updating
all the metrics.
2022-06-15 10:54:51 +02:00
Antonio Scandurra e627636760 Track active projects in metrics
An active project is defined as a project where there has been at
least a buffer edit, a join request/response, or a follow update
in the last minute.
2022-06-15 10:33:20 +02:00
Antonio Scandurra 95a5094487 Exclude admins from collected metrics 2022-06-14 16:26:00 +02:00
Antonio Scandurra c9943d6f39 Merge pull request #1172 from zed-industries/more-logs
Add more logging to `collab` to better understand user behavior
2022-06-13 09:22:37 +02:00
Antonio Scandurra a6cc293327 Don't retain message payloads in span, just log the payload instead 2022-06-13 09:06:58 +02:00
Antonio Scandurra b1cfad4d4a Log extension counts when worktree is updated 2022-06-13 08:57:21 +02:00
Max BrunsfeldandAntonio Scandurra 3a4c8743f3 Add OpenMetrics endpoint exposing the basic RPC store metrics as guages
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-10 13:32:56 -07:00
Antonio Scandurra 18a5f6e96f WIP: Start adding more logs 2022-06-10 18:17:02 +02:00
Keith Simmons 69bc9489f6 Add integration test and fix hovering over the wire 2022-06-07 14:22:02 -07:00
Max Brunsfeld 5b61e763be Update connected users' invite info when they are granted invite codes 2022-06-06 11:14:01 -07:00
Max Brunsfeld 26063722ed Don't update contacts when a project is first registered
Until the host has sent an UpdateProject message to populate the project's
metadata, there is no reason to update contacts.
2022-06-02 17:41:21 -07:00
Max Brunsfeld 0591ddd47a Change project registration RPC APIs to smooth out UI updates
* Make `UnregisterProject` a request. This way the client-side project can wait
  to clear out its remote id until the request has completed, so that the
  contacts panel can avoid showing duplicate private/public projects in the
  brief time after unregistering a project, before the next UpdateCollaborators
  message is received.
* Remove the `RegisterWorktree` and `UnregisterWorktree` methods and replace
  them with a single `UpdateProject` method that idempotently updates the
  Project's list of worktrees.
2022-06-02 17:32:43 -07:00
Antonio Scandurra cf0c9b089c Merge branch 'main' into project-panel-with-new-mouse-events 2022-05-30 18:29:46 +02:00
Antonio Scandurra 43d4ea886c WIP: start on an integration test for copy_entry 2022-05-30 14:53:10 +02:00
Antonio Scandurra b51f73b096 Implement copy paste for ProjectPanel 2022-05-30 14:52:34 +02:00
Max Brunsfeld f1e513a333 Move integration tests into their own file 2022-05-27 17:20:05 -07:00
Max Brunsfeld 8839e4c35e Clean up integration tests
* Use 'build_local_project' helper to reduce boilerplate
* Peform the setup steps in a consistent order
2022-05-27 17:10:45 -07:00
Max Brunsfeld 352115d447 Adjust test to flush effects between splitting pane and following
Panes now emit an event when adding the first item, so we need to flush
effects between splitting and following in order to avoid accidentally
cancelling the follow.
2022-05-27 10:53:14 -07:00
Max Brunsfeld 4e308c6fa7 Emit an event when adding a worktree to a project 2022-05-27 10:48:47 -07:00
Nathan Sobo 1ba10ddfb4 Implement /rpc_server_snapshot endpoint
This returns a JSON snapshot of the state of the server
2022-05-25 17:42:25 -06:00
Antonio Scandurra e121f87eea Merge pull request #1050 from zed-industries/ignored-files
Show ignored entries in project panel
2022-05-24 10:57:16 +02:00
Antonio Scandurra 4f5a32e850 Fix logic error when streaming ignored entries
We were calling `next` twice, which led us to skip every other entry.
This commit also enhances the `test_share_project` integration test
to exercise this new streaming logic.
2022-05-24 09:03:05 +02:00
Nathan Sobo d1bcff6ea8 Merge remote-tracking branch 'origin/main' into invite-codes-2 2022-05-23 15:46:39 -06:00
Antonio Scandurra 2ec31aa0b6 Broadcast proto::UnregisterProject when host closes a project 2022-05-23 15:38:01 +02:00
Nathan Sobo ed5f5dc722 Accept an optional email address when creating new users 2022-05-20 20:25:21 -06:00
Antonio ScandurraandNathan Sobo c34ead1401 Rename first_connection to connected_once
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-05-20 17:35:00 +02:00
Antonio Scandurra bb53ff8611 Send a ShowContacts message the first time a user connects to collab 2022-05-20 15:47:14 +02:00
Antonio Scandurra d3a80c0f7c Update users and invite count after an invite gets redeemed 2022-05-20 12:02:31 +02:00
Nathan SoboandAntonio Scandurra 3b4085b654 Add affordance to copy user's invite link if they have a code
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-05-19 17:57:46 -06:00
Max Brunsfeld a500249333 Replace build_workspace fn with an initialize function that takes a workspace
This makes it clearer that the function is not providing necessary
dependencies to a workspace, but rather configuring it with all of
the panels and widgets which are defined in downstream crates.
2022-05-19 16:50:22 -07:00
Max Brunsfeld e6011794ca Remove AppState from workspace actions
This allows those actions to be bound to keystrokes in the keymap.
Also, remove the WorkspaceParams struct, simplify how Workspaces are
constructed.
2022-05-19 14:37:26 -07:00
Antonio Scandurra 32b92599e6 Merge branch 'main' into request-to-join-project 2022-05-17 14:55:20 +02:00