Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Conversation

@fdionisi
Copy link
Owner

@fdionisi fdionisi commented Jul 29, 2019

Here's finally an initial implementation I'm proud.
Xray CRDT representation is now based on Memo. It is possible to open local and remote projects, but some more work to perfection it must be performed.

Features to add/re-enable:

  • Receive replica_id from remote frontend
    Memo uses UUID as replica ids – we can suppose that each user should have a unique replica id.
    At this point, workspaces are paired to a user through an uszie user_id.

    Ideally, when we first open Xray, it should create and store a new UUID that will always be used as replica_id when opening local WorkTrees.

    When using Xray in the browser, the frontend should define the replica_id and send it to the server application. Initially, it can be generated on a connection base, but later on, should be collected from GitHub OAuth or similar.

  • Proper handle goal_column on selections
    Memo's Selection implementation is missing goal_column – being a strict UX requirement. I need to create a wrapper around Memo's Selection that can persist the goal_column after

  • Enable Save action
    The previous implementation of the buffer was able to communicate with the server through RPC. I feel it should be Workspace/Project responsibility to save buffer to the FileSystem.

  • set_active_location on WorkspaceView.set_active_buffer_view

Bug to be fixed:

  • Fix: Properly propagate edits

  • Fix: Enable to open and edit the same file multiple times
    I think this issue could be related to the one above.

  • Fix: already borrowed: BorrowMutError on remote

Support tasks to be completed:

  • Pass all tests
    During this re-implementation, an effort was made to keep the existing test suit up to date, and it helped a lot in properly shape Memo's integration. Unluckily, due to my poor knowledge on how to effectively test async Rust code, some tests have been commented out.

  • Enable benchmarks

  • Remove commented code

  • Prepare new visual rpc implementation

  • Write new update doc

As always, suggestions and/or help are always more than welcome!

Federico added 5 commits July 29, 2019 18:25
Due to changes in how `Buffer` is created, I decided to move benchmarks
side by side to the code so it's possible to reuse `Test*` traits to
easily measure. Moreover there is a crate less to be installed.

Ergonomics are not the best since all ignored tests are being included
in the output of `cargo bench` and I'm thinking of a way to improve
this.

Interestingly results shows a big issue in `BufferView.add_selection_above`.
Same measurements are fine when performing a similar test directly on
the `Buffer`.
The `replica_id` is now passed by the remote client to the application
when connecting to a Workspace. This ensures that all operations
produced by a user will be linked to him.

During boot in the browser, a `replica_id` retrieved or created and
saved in the localStorage. In the future, a "login with GitHub" button
should be shown to retrieve and use the `user_id` as the replica one.

With this commit `UserId` has been removed and all references to a
user will be dictated by a `ReplicaId` instead.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants