Live-share: CTRL + Z stuck down, ~10 minutes of work undone

Created on 4 May 2018  路  26Comments  路  Source: MicrosoftDocs/live-share

Product and Version [VS/VSCode]: 1.23
OS Version [macOS/Windows]: Windows 10
Live Share Extension Version: 0.3.51
Target Platform or Language [e.g. Node.js]: TypeScript

Steps to Reproduce / Scenario:

The LiveShare host pasted some lines, and then held down CTRL + Z to undo them. He let go, but VS Code kept undoing until it ran out of history. CTRL + Y didn't do anything, but another CTRL + Z did prompt a similar string of re-do commands (though it didn't put everything back). It was very bizarre.

I know that's really vague, we're not entirely sure what happened, but we did lose about 10 minutes of work (in a rather dramatic fashion) and wanted to at least report something.

I can try to elaborate if you have specific questions.

co-edit bug vscode

All 26 comments

@paterasMSFT YUCK! So sorry that happened. We'll want to get on that. Could you run the "Live Share: Export Logs" command for the host and guest so we can take a look at what went wrong?

ATTN: @grork

Were you able to repro with pasting? Were both sides windows & vscode? Were your line endings CRLF or LF (as indicated in the bottom corner of VSCode)?

Of note, I made some fixes a day or so ago in this space -- exactly related to these types of situations. It might be addressed in the next extension update, and if you have a reproable scenario & could try it again, that'd be _ace_

@paterasMSFT In fact, we just released 0.3.90 that should have the change @grork mentioned in it. Would love to know if it still repros.

Logs attached, but they were exported after we started a new session.

Both sides are Win10, VSCode, and CRLF. We don't know how to repro (we've been avoiding CTRL + Z ever since).

How do I get 0.3.90? Latest on GitHub is 0.3.51.

logs.zip

@paterasMSFT By just released - I mean 2 minutes before I responded. :)

Latest in the marketplace is now 0.3.90. Likely if you start up or restart VS Code and have auto update turned on it will come down without you doing anything.

0.3.90 received. I'll report back if I see the issue again. Feel free to close this if you want. I just wanted to make sure someone was aware.

@paterasMSFT Will do - please do let us know if you run into problems again.

This also occurred with version 0.3.90 and wasted a lot of my/our time.

Both sides where using VS Code on Windows, line endings: CRLF

Can confirmed. Encountered this problem also in the 0.3.90 as well. Undo was stuck as long as my partner was in the live share editor window. As soon as he tabbed out/lost focus of the window it worked again until he tabbed back into it.

Hrm. Can you provide a little more detail on exactly what you were doing before you (or the other participant) performed the undo?
a) You were both in the same file?
b) Were you editing the same section of the document, or different sections?
c) When Ctrl+Z was performed, what was the other participant doing? (Idle, typing?)
d) What had you done before the Ctrl+Z? The original report here mentioned pasting -- is that what happened in this case? (Ctrl+Z immediately after a paste?)

a) Yes, both in the same file
b) Pretty sure we where in different sections
c) Pretty sure the other participant was typing
d) No pasting before Ctrl+Z

I'll try to reproduce this issue later.

My view Screen of my view
Partner view Screenshot

We spammed a bit the Undo shortcut while one was typing and soon after (for the person who used the command) the undo command stopped to work completely.

We switched the roles (the one with a not working undo function typed now and the other used the undo command) and it worked perfectly.

Redo didn't worked at all after that for both partners. And after Spamming Undo for a few seconds this error occurred. After a while we noticed that our views are no longer in sync. (I saw what he was doing, he didn't saw my stuff at all)

But overall we couldn't reproduce the error we encounter a few hours ago.

Back then I was able to trigger it by holding the Undo shortcut for around 5 sec, while my partner was working normally (dunno what he did exactly)

Btw. In all scenarios I was the guest and my partner hosted the sessions.

Is there any log I can send/look into?

Just to clarify: me and @Diesmo where testing this together.
The bug shown in the screenshots caused @Diesmo's changes not to be tranmitted to me but mine where still being transmitted to him.

@Chuxel / @grork I'd suggest reopening this issue, undo/redo seems broken in multiple ways/cases

Reproducing one of the bugs is trivial when undoing while the other user is typing.

Yes; this should be reopened. I think I understand the issue enough, and the clear repros of mash-undo-one-side, while the other side mashes-on-the-keyboard-differently help understand what dropped you in to the scenario.

Redo is currently disabled if someone _else_ has made an edit in that document more recently that you. I'm looking into it, but it's not working right at all, so we (I) disabled it. It shouldn't effect normal undos (e.g. you were the last person to make an edit before undoing, should work like in a non-live-share situation)

hello everyone,

I came here to report the exact same issue. I don't have much more information to share unfortunately but here is what I think can be relevant information:

  • I was hosting the session on Windows
  • I was sharing the session with a coworker who is on Linux
  • We've been using Liveshare since a couple hours today before it happened
  • Coworker was away since a while from his computer when it happened (and not in the same file)
  • I copy-pasted a chunk of code (~600 lines) into a new file I created and I was editing this file
  • After a good 10-15 minutes of editing I typed ctrl-z in my new file and it got stuck and removed all the code and edits I made until file became completely empty
  • ctrl-y didn't restore my code
  • I enabled this setting during my session: "files.trimTrailingWhitespace": true
  • Slightly unrelated but: The setting above doesn't work well with Liveshare since it seems to save every second. It makes editing annoying because it sometimes removes indentation and space while I'm typing

edit:
VSCode version 1.22.2

Just to make sure I think I've got the details:
a) No-one was actually editing on the remote site at the time this occurred, you were just you, but someone was _connected_
b) Brand new file, where you pasted a large amount of code, and then proceeded to edit it just like normal.
c) you pressed ctrl+z to undo, expecting it to do some small change (your last local change, since you were the last person to edit it), but instead it shot past, and removed all your code

@grork yes exactly.
a) yes, I was editing alone and my coworker was still connected but he was busy with someone else so his computer was unattended.
b) yes
c) yes, it was like if I was holding down on ctrl-z on my keyboard. I saw all my changes being reverted very quickly until there was nothing else to undo.

@grork
for us (me and @irgendwr ) it was somewhat similiar but differnt in point b

a) yes, only one was typing
b) No, we have reopened a project in live share, which we already started a week earlier in a live share session. And I also don't remember any pasting into it.
c) yes, as @irgendwr used crtl+z he certainly didn't expected to see all our work getting vanished ^^

Same issue while developing python with a colleague. Here are my system specifications:

VS Code version: Code - Insiders 1.24.0-insider (https://github.com/Microsoft/vscode/commit/25aab64fccf650e2be3d19d613e51b26100300a8, 2018-05-10T05:16:09.756Z)
OS version: Windows_NT x64 10.0.16299


System Info

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 7 1700X Eight-Core Processor (16 x 3394)|
|GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled|
|Memory (System)|15.93GB (8.88GB free)|
|Process Argv|C:\Program Files\Microsoft VS Code Insiders\Code - Insiders.exe|
|Screen Reader|no|
|VM|29%|

Extensions (12)

Extension|Author (truncated)|Version
---|---|---
vscode-css-formatter|aes|1.0.1
vscode-eslint|dba|1.4.8
githistory|don|0.4.0
xml|Dot|1.9.2
shell-format|fox|1.1.3
vscode-github|Kni|0.28.1
python|ms-|2018.4.0
Go|ms-|0.6.79
vsliveshare|ms-|0.3.98
vscode-docker|Pet|0.0.26
remote-vscode|raf|1.1.0
vscode-import-cost|wix|2.6.2


Merging #364 from @aTaQu


Issue Type: Bug

I am not certain what caused it, but these were the last steps before it began. Restarting vscode fixed the issue.
My partner created a file on the system (i am the host) after a while i typed a few leters and clicked ctrl + z and my vscode just started deleting the content of any file i went into. Clicking ctrl + shift + z seemed to bring it back for a mili second just to be deleted again.

Extension version: 0.3.98
VS Code version: Code 1.22.2 (3aeede733d9a3098f7b4bdc1f66b63b0f48c1ef9, 2018-04-12T17:28:16.777Z)
OS version: Windows_NT ia32 10.0.16299


System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz (4 x 3504)|
|Memory (System)|15.91GB (7.34GB free)|
|Process Argv|C:\Program Files (x86)\Microsoft VS Code\Code.exe E:\work\simply-pwa|
|Screen Reader|no|
|VM|0%|



@aTaQu Thanks for raising the issue. You may be hitting #291. Does that issue match what you were seeing? If so, we can merge this issue with that one.


It seems similiar but not exactly the same. As only a restart stopped the issue, if i selected any file the same ctrl+z would just keep getting spammed non stop no matter to which file i went, after undoing 3 files i restarted and the issue disapeared. Though some kind of local history of a file would be nice not to lose any projegress to a bug of similiar nature. And it happened again that same day. I didnt try another files the 2nd time just restarted VS code immediately. We were both working on the same file, different lines, i ( the host) pressed a single undo command which kept repeating until the file became empty, clicking ctrl shift z seemed to bring back the code for a glimpse only for it to get instantly undone like the previous time. I can elaborate if you have any questions. !

In the extension update today we have improved, but _not_ completely fixed the issue.
There are two specific changes:

  • We can at least detect when we're just constantly undoing and nothing happens. In this situation it should now "replay" everything that it un did. This isn't excellent, but it should mitigate it.
  • We added lots more logging & tracing in this scenario that will be captured in the logs

When you hit this now, you should end up wiht a long set of your data disappearing, and reappearing. When this happens _please_ export your logs immediately, and send them on over to [email protected]. We're having a hard time actually reproing it _consistently_.

Hello all -- has anyone continued to experience this issue? Are they seeing anything odd with Undo?

@grork Yes
Working with three people. CMD + Z started deleting all the added code.

Ok, great (well, not great). I have some questions to understand what you were doing when it happened, and what exactly happened.

  1. What version of the extension were you using? We made some changes to mitigate the _loss_ of edits
  2. Did you not see all the deleted code come back?
  3. It should have 'stopped' and let you type again -- did you not see that?

What was happening when you pressed undo?

  1. How many people were in the file you were working on?
  2. Were they typing at the same time _in that file_?
  3. Were you expecting to undo something you'd just typed, or was this something that had happened a while ago?

If you repro this 'easily', can you capture logs (Command Palette, Live Share: Export Logs), and attach here -- that would really help try and nail it down.

@grork

  1. Version: .2.95 (if memory serves)
  2. Yes we could get the code back by doing CMD + Y
  3. Yes

  1. 3 people
  2. Yes we were editing in the same file
  3. Just typed

live-share.zip

This should be resolved in 0.3.384!

Was this page helpful?
0 / 5 - 0 ratings