Commit Graph

674 Commits

Author SHA1 Message Date
Max Brunsfeld
ad37034960 Identify LiveKit room participants by user id, not peer id
This way, their participant id can remain the same when they reconnect.
2022-12-15 17:19:32 -08:00
Antonio Scandurra
c2f5381e5a collab 0.4.0 2022-12-15 19:37:53 +01:00
Antonio Scandurra
2679e245a5 Minor stylistic change 2022-12-15 16:40:16 +01:00
Antonio Scandurra
5a334622ea 💄 2022-12-15 16:34:59 +01:00
Antonio Scandurra
5720c43fe7 Merge branch 'main' into fix-reconnects-after-deploy 2022-12-15 15:32:05 +01:00
Antonio Scandurra
5fb522a9b1 collab 0.3.14 2022-12-15 11:31:51 +01:00
Antonio Scandurra
86e5ae1f2e Allow nulls in projects.host_connection_{id,server_id}
The server version on stable won't be able to fill values for those
columns when we deploy the migration to preview.

With this commit we're also dropping the unused `worktree_extensions`
and `project_activity_periods` tables. The last version of the server
on stable (0.2.6) doesn't contain any code that accesses those tables.
2022-12-15 11:30:51 +01:00
Antonio Scandurra
aadd7f2886 collab 0.3.13 2022-12-15 10:53:17 +01:00
Antonio Scandurra
067a19c971 Avoid logging an error when user who hasn't joined any room disconnects 2022-12-15 10:45:03 +01:00
Antonio Scandurra
688f179256 Use "id" nomenclature more consistently 2022-12-15 10:15:59 +01:00
Antonio Scandurra
af77f1188a Re-add server_id indices for room_participants/project_collaborators 2022-12-15 09:58:25 +01:00
Julia
0dedc1f3a4 Get tests building again 2022-12-15 00:17:28 -05:00
Max Brunsfeld
6c58a4f885 Fix stale server queries, use foreign keys from connectionsn to servers 2022-12-14 17:34:24 -08:00
Max Brunsfeld
e08d6cd6de
Merge pull request #1921 from zed-industries/multibuffer-following
Allow following collaborators into editors with multi-excerpt buffers (refactors + find-all-refs)
2022-12-14 15:33:11 -08:00
Max Brunsfeld
954c9ac3fd Add integration test coverage for following into multibuffers 2022-12-14 15:28:58 -08:00
Max Brunsfeld
e4c5dfcf6c Use run_until_parked instead of 'condition' in all integration tests 2022-12-14 15:05:35 -08:00
Antonio Scandurra
363e3cae4b WIP 2022-12-14 19:25:07 +01:00
Antonio Scandurra
930be6706f WIP 2022-12-14 18:02:39 +01:00
Antonio Scandurra
05e99eb67e Introduce an epoch to ConnectionId and PeerId 2022-12-14 15:55:56 +01:00
Antonio Scandurra
9bd400cf16 collab 0.3.12 2022-12-14 11:43:33 +01:00
Antonio Scandurra
674fddac87 Instrument rpc::Server::start and reduce cleanup timeout again 2022-12-14 11:42:12 +01:00
Antonio Scandurra
63e7b9189d collab 0.3.11 2022-12-14 11:25:04 +01:00
Antonio Scandurra
9530976f61 Try using a longer timeout for cleaning up stale rooms 2022-12-14 11:24:36 +01:00
Antonio Scandurra
02c30b0091 collab 0.3.10 2022-12-14 09:35:52 +01:00
Antonio Scandurra
b9c7796547 Reduce readiness probe delay and period 2022-12-14 09:35:36 +01:00
Antonio Scandurra
e00cb6b074 collab 0.3.9 2022-12-14 09:05:19 +01:00
Antonio Scandurra
dc47552180 Fix kubernetes configuration for readiness probe 2022-12-14 08:58:19 +01:00
Antonio Scandurra
98a593b263 collab 0.3.8 2022-12-14 08:56:02 +01:00
Antonio Scandurra
897506c797 Define readiness probe to know when the new server can accept traffic 2022-12-14 08:54:46 +01:00
Antonio Scandurra
59c9a57570 collab 0.3.7 2022-12-14 08:43:18 +01:00
Antonio Scandurra
dde6cf596e Don't wait for stale project deletion before listening for connections 2022-12-14 08:42:34 +01:00
Antonio Scandurra
2596fefa04 collab 0.3.6 2022-12-13 23:09:02 +01:00
Antonio Scandurra
34b69896e4 Listen to SIGTERM in addition to ctrl-c for graceful shutdown 2022-12-13 23:08:43 +01:00
Antonio Scandurra
7824ace58b collab 0.3.5 2022-12-13 22:40:55 +01:00
Antonio Scandurra
b150efbd96 Set log level to debug for preview deployment
Also, add a log statement when we receive the interrupt signal.

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-12-13 22:38:55 +01:00
Max Brunsfeld
c20204d269 collab 0.3.4 2022-12-13 11:17:37 -08:00
Max Brunsfeld
45bfcfc3b8 Fix excessive delay before clearing stale room data
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-12-13 11:17:20 -08:00
Max Brunsfeld
5218a2f966 collab 0.3.3 2022-12-13 10:17:01 -08:00
Max Brunsfeld
95748123b5 Merge remote-tracking branch 'origin/collab-0.3.x' 2022-12-13 10:16:25 -08:00
Max Brunsfeld
6ad326ac58 Wait longer before deleting outdated rooms from the database
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2022-12-13 10:14:43 -08:00
Antonio Scandurra
99c5f8c713 collab 0.3.2 2022-12-13 15:16:41 +01:00
Antonio Scandurra
073a2988e6 Move creation of room_id index into its own migration 2022-12-13 13:57:41 +01:00
Antonio Scandurra
70aac75dd5 Run until parked before asserting about participants in restart test 2022-12-13 13:53:51 +01:00
Antonio Scandurra
4dc838fbb7 Reset connection pool when tearing down the server in tests 2022-12-13 13:51:25 +01:00
Antonio Scandurra
d4c8fa3090 Use a synchronous mutex for ConnectionPool 2022-12-13 13:50:51 +01:00
Antonio Scandurra
a594ba8f8a Simulate server restarts in randomized test 2022-12-13 12:18:38 +01:00
Antonio Scandurra
417db95693 Fix typo in index name 2022-12-13 11:44:48 +01:00
Antonio Scandurra
0220d7ba5d Include room_id in CallCanceled message
This ensures we don't accidentally cancel old calls.
2022-12-13 11:43:09 +01:00
Antonio Scandurra
e2b132ef23 💄 2022-12-13 11:37:39 +01:00
Antonio Scandurra
7e8d9d52d3 Delete stray debug statement 2022-12-13 11:36:40 +01:00
Antonio Scandurra
6a6a032f1f Delete stale rooms/participants after RECONNECT_TIMEOUT 2022-12-13 11:32:37 +01:00
Antonio Scandurra
beea9b68ff Allow re-joining room after server restarts 2022-12-12 16:03:21 +01:00
Antonio Scandurra
3cd77bfcc4 Always cast connection ids to i32
Postgres doesn't support unsigned types. This also adds indices to
support querying `project_collaborators` and `room_participants`
by connection id.
2022-12-12 11:43:08 +01:00
Antonio Scandurra
456396ca6e Rename connection_lost to answering_connection_lost 2022-12-12 11:43:08 +01:00
Antonio Scandurra
26b5653427 Delete hosted projects from database when connection is lost 2022-12-12 11:43:08 +01:00
Antonio Scandurra
895c365485 Introduce random reconnections in the randomized test 2022-12-12 11:43:08 +01:00
Antonio Scandurra
8fa26bfe18 Fix test_calls_on_multiple_connections after adding room reconnection 2022-12-12 11:43:08 +01:00
Antonio Scandurra
aca3f02590 Re-join room when client temporarily loses connection 2022-12-12 11:43:08 +01:00
Antonio Scandurra
d74fb97158 Remove Executor trait from collab and use an enum instead
This will let us save off the executor and avoid using generics.
2022-12-12 11:43:08 +01:00
Antonio Scandurra
0366d725ea collab 0.3.1 2022-12-09 08:19:41 +01:00
Antonio Scandurra
2697112a8a Don't drop unregistered column in reconnection support migration
We don't use this column anymore because, when a project is unshared, we
simply remove it from the `projects` table. However, this column is expected
in the stable version of the server and the database is shared between stable
and preview. If we dropped it, stable would start throwing errors.
2022-12-09 08:11:18 +01:00
Mikayla Maki
925c9e13bb Remove terminal container view, switch to notify errors 2022-12-08 20:21:00 -08:00
Joseph Lyons
ab978ff1a3 collab 0.3.0 2022-12-08 16:35:13 -05:00
Joseph T. Lyons
dcd4b8f7db
Merge pull request #1941 from zed-industries/Allow-overwriting-signup-data
Allow overwriting signup data if a user signs up more than once with the same email address
2022-12-08 16:11:28 -05:00
Joseph Lyons
d71d543337 Ensure that subsequent signup happens after initial
We can't rely on the fact that the test won't run fast enough such that both `created_at`s are the same time.  This ensures the subsequent signup happens after the initial one and that the database doesn't overwrite the initial one.
2022-12-07 08:15:01 -05:00
Antonio Scandurra
665219fb00 Fix inviting user that had already signed up via a different email 2022-12-07 14:07:01 +01:00
Antonio Scandurra
1b8f23eeed Add failing test showcasing inviting existing user via different email 2022-12-07 14:06:59 +01:00
Joseph Lyons
5f31907127 Clean up test 2022-12-07 07:12:27 -05:00
Joseph Lyons
97989b04a0 Remove comment 2022-12-06 17:18:54 -05:00
Joseph Lyons
694840cdd6 Allow overwriting signup data if a user signs up more than once with the same email address 2022-12-06 17:12:12 -05:00
Antonio Scandurra
3b5b48c043 Query project count as i64 instead of i32 when gathering metrics
Using the latter will cause a type mismatch when performing the query.
2022-12-06 15:00:32 +01:00
Antonio Scandurra
fc7b01b74e Fix busy status when accepting a contact request
Previously, we would send an contact update when accepting a request
using the same `busy` status for both the requester and the responder.
This was obviously wrong and caused the requester to see their own
busy status as the newly-added responder contact's status.
2022-12-06 10:19:34 +01:00
Antonio Scandurra
744714b478 Remove unused UserId import from seed script 2022-12-06 09:07:25 +01:00
Antonio Scandurra
9a62150dce Merge branch 'main' into reconnections-2 2022-12-05 19:18:40 +01:00
Antonio Scandurra
7bbd97cfb9 Send diagnostic summaries synchronously 2022-12-05 19:07:06 +01:00
Antonio Scandurra
5443d9cffe Return project collaborators and connection IDs in a RoomGuard 2022-12-05 18:37:01 +01:00
Antonio Scandurra
be3fb1e985 Update sea-orm to fix bug on failure to commit transactions
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-12-05 18:36:25 +01:00
Antonio Scandurra
b97c35a468 Remove project_id foreign key from room_participants 2022-12-05 15:16:06 +01:00
Antonio Scandurra
eec3df09be Upgrade sea-orm 2022-12-05 14:56:01 +01:00
Antonio Scandurra
d3c411677a Remove random pauses to prevent the database from deadlocking 2022-12-05 12:03:45 +01:00
Antonio Scandurra
d97a8364ad Retry transactions if there's a serialization failure during commit 2022-12-05 10:49:53 +01:00
Antonio Scandurra
0ed731780a Remove duplication between transaction and room_transaction 2022-12-05 09:46:03 +01:00
Julia
11c1254e71
Merge pull request #1924 from zed-industries/simon-says-dont-move
Do not reorder tab opened by follower to end of item list
2022-12-04 13:00:07 -05:00
Kay Simmons
1cc3e4820a working serialized writes with panics on failure. Everything seems to be working 2022-12-03 16:06:01 -08:00
Mikayla Maki
992b94eef3 Rebased to main 2022-12-03 16:06:01 -08:00
Kay Simmons
d20d21c6a2 Dock persistence working!
Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
2022-12-03 16:06:01 -08:00
Kay Simmons
c1f7902309 wip 2022-12-03 16:06:01 -08:00
Mikayla Maki
4798161118 Distributed database pattern built.
Co-Authored-By: kay@zed.dev
2022-12-03 16:06:01 -08:00
Mikayla Maki
a5edac312e Moved to workspaces crate... don't feel great about it 2022-12-03 16:05:26 -08:00
Mikayla Maki
3451a3c7fe Rebase - Got Zed compiling and fixed a build error due to conflicting dependencies that cargo didn't catch :(
Co-Authored-By: kay@zed.dev
2022-12-03 16:04:10 -08:00
Julia
4bc1d77535 Fix tab following order test to wait for file open to propagate
Now it can actually repro the original bug

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-12-02 16:09:37 -05:00
Antonio Scandurra
d96f524fb6 WIP: Manually rollback transactions to avoid spurious savepoint failure
TODO:
- Avoid unwrapping transaction after f(tx)
- Remove duplication between `transaction` and `room_transaction`
- Introduce random delay before and after committing a transaction
- Run lots of randomized tests
- Investigate diverging diagnostic summaries

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-12-02 20:36:50 +01:00
Antonio Scandurra
1c30767592 Remove stale Error variant
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-12-02 19:20:51 +01:00
Antonio Scandurra
969c314315 Merge branch 'main' into reconnections-2 2022-12-02 19:09:33 +01:00
Antonio Scandurra
568de814aa Delete empty rooms 2022-12-02 16:56:41 +01:00
Antonio Scandurra
27f6ae945d Clear stale data on startup
This is a stopgap measure until we introduce reconnection support.
2022-12-02 16:30:00 +01:00
Antonio Scandurra
1b46b7a7d6 Move modules into collab library as opposed to using the binary
This ensures that we can use collab's modules from the seed script
as well.
2022-12-02 14:37:52 +01:00
Antonio Scandurra
7502558631 Make all tests pass again after migration to sea-orm 2022-12-02 14:22:36 +01:00
Antonio Scandurra
48b6ee313f Use i32 to represent Postgres INTEGER types in Rust 2022-12-02 13:58:54 +01:00
Antonio Scandurra
dec5f37e4e Finish porting remaining db methods to sea-orm 2022-12-02 13:58:23 +01:00