multihack/multihack-web

Prompt user to fetch code after joining

kifhan opened this issue · 4 comments

screenshot_2017-04-23_08-35-00_multihack_bug

How it happened.

  1. Client 1 connect to the room.
  2. Client 1 creates code file and start edit it. Adds some words.
  3. Client 2 connect to the same room. But Client 2 see no file in the room.
  4. Client 1 Adds more words.
  5. Now Client 2 see the file. And able to edit it. But see contents only after 4.
  6. Client 2 starts edit, but contents is not fully synced so line number is mixed, then it overwrites contents on 2.

I believe it's a problem about Operational_transformation.

You need to "fetch code" on joining to make sure you have the same initial project.

  1. Make sure all your team members have the same code (or use the fetch code feature).

Just click the little "Refresh" icon next to "Project Files" after you join the room.

It doesn't automatically do this because you might already have the parts of the project that you want, so there's no point in sending it.

To be clearer: Between your step 3 and 4, Client 2 should be pressing the "Fetch Code" button. (The refresh icon next to Project Files)

screen shot 2017-04-22 at 8 06 57 pm <-- This

This is sort of confusing, I know. I'll add a prompt to Fetch Code on joining.

There's plans to change this so it's more like you expect.

"Fetch Code" just automatically launches at startup. It gives us initial convergence and will works for most use cases.

Only big projects will have an issue, and I'll just add an option to skip syncing. They can use Git or something more suitable to obtain initial convergence.

The web editor can't even handle projects that large anyways (at the moment).