Live-share: Desync

Created on 10 May 2019  路  23Comments  路  Source: MicrosoftDocs/live-share

Product and Version [VS/VSCode]: VSCode
OS Version [macOS/Windows/Linux]: Windows (both the client and the host)
Live Share Extension Version:
Target Platform or Language [e.g. Node.js]: Python

What were you doing when you encountered the desync?
The client creates a new file by copying & pasting & renaming in the expolorer within VSCode.
In the host side, the user can notice that the file can be successfully renamed. However, any modifications that the client makes cannot be synced in the host side. The client cursor is not visible, too.
In the meantime, modifications that the host makes can be synced in the client side.

How often have you encountered desyncs?
I have tried two times of this action and the desync occurs everytime.

co-edit bug desync product-feedback

Most helpful comment

Hey @klakin-pivotal , this is actually something we briefly considered, but decided it would be best to invest resources in actually fixing the desyncs. However, since we've been slow to deliver on that, maybe we should revisit providing such a button. I'll keep you posted with updates! To others on the thread, would that be useful as a stopgap?

All 23 comments

Thanks for reporting @lzl1918 ! I think you're the first user to actually give a clear repro of a desync. We're working on this and will hopefully have a fix out soon. The issue is with renaming files, so in the meantime, to avoid desyncs, you may want to avoid this type of usage. I'll reach back out when we have this resolved.

Posting here although slightly unrelated. In my case - guest and host cursors were visible from both sessions (I'm the guest and host). The files appeared de-synced, random parts of the file disappeared (no copy-paste was involved). In my case - Host and Client were both Windows 10 working on a Git repo of a Python project

A temporary workaround if the file was tracked in a Git repo -
I could delete the file from the client side, and then do a git stash. That got me back to the file I was expecting to see.

I can't provide any logs as I'd have to do a lot of scrubbing (Apologies!)

Thanks for the info! And no worries about the logs, I don't think they'd provide much additional info of value.

What are you seeing in the logs that you'd have to scrub? We try to keep the logs free of any sensitive information so that people like you can comfortably post them without privacy/security concerns.

In the meantime, when we get out of sync, is there any sort of force refresh option we can use? Disconnecting and reconnecting does not seem to be enough and the only workaround I've found is for the host to kill the session and start a new one.

It would be nice if there was a cmd-p (or ctrl-p) "Live Share: force refresh" or "Live Share: force refresh file" option that would dump what live share thinks it knows about the current file (or whole tree) and refreshes from the host what the real state is.

@bjornicus that's an excellent suggestion. The only reason we haven't done this yet is because it shouldn't be necessary - coediting is the most fundamental piece of Live Share, and staying in sync is essential. We're currently investing in improving the reliability, with the goal being that desyncs never occur. But we'll consider taking your suggestion (as a temporary mitigation) .

Could this also be related to a F2 refactor/rename action that causes a desync? Me, a participant tried to refactor a class name and it wasn't working. Then the host attempted to refactor a variable name in the class as a test and it desync'd the moment he hit F2 to rename it.

@bzuillsmith that's an interesting one that I hadn't heard before. Are you able to repro it?

Just a little more info. In my case, I had a desync occur in a different way. The host created a new file and made some edits which I could see. Then, he copied over some code from a different file that was also in the project and it desync'd. It is worth mentioning that this is not reliably reproducible.
I am on Windows 10 Version 1909 with VSCode 1.43.2 and Live Share 1.0.1891.
I have had desyncs on both Verilog and Python projects (those are the only two languages I use as of late, so I can't speak for more than that). I also have the Vim plugin for VSCode if that's important.

Thanks @Lexden12 ! That's tremendously useful.

I'm getting desyncs as well, and because there's no option to force a resync, I have to kick out all the participants to start a new session.

As a stopgap, a "Request that the Host resync all of the files in the project" button would be _amazing_. Honestly, if the underlying issue never gets fixed, a reliable "Force a Resync" button would resolve this issue for me.

Hey @klakin-pivotal , this is actually something we briefly considered, but decided it would be best to invest resources in actually fixing the desyncs. However, since we've been slow to deliver on that, maybe we should revisit providing such a button. I'll keep you posted with updates! To others on the thread, would that be useful as a stopgap?

Absolutely, the other option (killing and restarting the session) interrupts the entire workflow and can get annoying if desyncs present themselves regularly.

100%. This bug is the reason a very rarely use live share. Every time I come back to live share and work on a project with someone where this error creeps up I always look for a refresh button until I eventually remember there isn't one. I'm usually on a call with the person I'm working with and so we are able to find out fairly quickly when things are out of sync, but it takes us forever to get them back in sync.

Yep refresh button would get me to try live share more. Additionally, it takes too much time to report such a bug with any helpful data (collecting logs, etc). I won't ask a pair or whole team to stop what they are doing to figure out how to report it and continue trying to use live share. It's easier to switch to a screen sharing app and continue working.

For example, I tested this in mob programming scenarios and we pretty quickly hit a desync. The team felt the value of live-share was unproven at that point so we weren't going to spend the time to figure out how to submit a proper bug report with logs and repro steps. If there was more automated reporting--a button leading to a quick form that automatically grabbed logs--we at least would have reported it before moving on to screen sharing. But we weren't about to spend the whole team's time figuring out how to reproduce it, collect logs, etc.

Thanks for the feedback @bzuillsmith . That's completely understandable and I appreciate you taking the time to engage on this issue 馃槉. I'm very grateful for all of our users that do go above and beyond to help us figure out these issues, because as you noted, it's a bit of a hassle.

Hi ,

I am also getting the same issue on live share when I save my work or edit code or open a new file and start editing on it , suddenly session ends with a message that "the host has ended the current collaberation session".

and on restart of session I don't see my saved work because of this issue we are unable to use this feature

we are using Visual studio 2019 Community edition On windows platform and C# language we are using.

Can you please tell us when can we expect fix for this ?

Hey @vsharmatest , that sounds like a potentially different issue than what's being discussed here. Is it possible you were experience internet connectivity issues?

I noticed it get out of sync when I created a file, renamed it and put some text in it/ saved it.

I'm also getting the desync issues, but the bigger problem isn't the error itself鈥攊t's that the problem often isn't announced until well after the desync actually happens. A colleague and I have had several instances today where we lost an hour's work due to someone continuing to work on a file that had since desynced; we didn't cotton on until the Follow feature failed to track them moving to a new file.

I'm very sorry to hear that @rensa 馃様. We're working on better desync detection at the moment that should ship next week (it'll be behind a special flag). That change will also include some diagnostic info that should help us figure out what caused the desync so we can finally fix this. I'll reach back out when we release that.

That's all right, @daytonellwanger! I was a little frustrated when I wrote that comment, but I'm very appreciative of the hard work you've all put into VSCode and Live Share. It's improving my work a lot!

Copying this repo from #3361:


If multiple lines of text are highlighted using CTRL-SHIFT-L and replaced with new text, Live Share will go out of sync. Clicking "Reconnect" will not resolve the issue - the live share session will need to be terminated and then spun back up.

This happens quite frequently - perhaps 80% to 90% of the time.

Was this page helpful?
0 / 5 - 0 ratings