microsoft / live-share

Real-time collaborative development from the comfort of your favorite tools
http://aka.ms/vsls
Creative Commons Attribution 4.0 International
2.27k stars 247 forks source link

Follow loop #389

Closed Diesmo closed 5 years ago

Diesmo commented 6 years ago

Today I got a liveshare invite from my project partner. After I joined I noticed some strange behavior: Buggy view gif

The problem seemed to be that I stilled followed the movement from my partner (from the last session) and he still followed mine. So I spawned at the top or so and he was already somewhere in the middle of the code. Then I scrolled for like 2 sec and then the view "bugged" out and begun to jump to each other views. (Note, what is seen in the gif isn't me trying to scroll down and getting reseted. All this happend by itself, I didn't touched the mouse/keyboard)

We both experienced this visual jumping, which is somewhat obvious (in the behavior if you think about it), but shouldn't happen imo. (like an exception when both participants follow each other one of them should become the main view or so)

After we understood the problem my partner unfollowed me and it was instantly fixed.

We are even able to reproduce it via:

  1. Both partner in a liveshare session follow each other
  2. One or both start to scroll in the code

This was tested under the latest liveShare version 0.3.114

irgendwr commented 6 years ago

Extension version: 0.3.114 VS Code version: Code 1.23.1 (d0182c3417d225529c6d5ad24b7572815d0de9ac, 2018-05-10T17:11:17.614Z) OS version: Windows_NT x64 10.0.16299

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz (8 x 3592)| |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.92GB (10.06GB free)| |Process Argv|C:\Program Files\Microsoft VS Code\Code.exe| |Screen Reader|no| |VM|0%|
lostintangent commented 6 years ago

@Diesmo Thanks for reporting this! When a guest joins a Live Share session, they automatically follow the host's cursor. However, the host never automatically follows a guest, unless they chose to. In your case, did the host explicitly start following you after you joined their session? I'm just curious if there's a bug in follow mode being enabled when it shouldn't have been.

irgendwr commented 6 years ago

I (as a host) explicitly followed him (contrary to what he wrote), so that part is fine. :)

lostintangent commented 6 years ago

@irgendwr OK cool, thanks for confirming that 👍 Out of curiosity: what would your expected/ideal behavior here be? That we auto-disable follow mode when you scroll (we already do this when you edit/switch files)? That we disallow following someone that is following you? That we simply display when someone is following you so that it’s clearer why you may be in this loop state? Something else?

irgendwr commented 6 years ago

1 and 2 both sound good to me. The second one (with a warning message) is what I would expect to happen.

lostintangent commented 6 years ago

@irgendwr Thanks!

// CC @jonwchu for your thoughts/consideration

Diesmo commented 6 years ago

The most logical thing would be to go with option 2 (disallow following someone who follows you)

But maybe there are some weird user scenario for this (which I can't think of right now) that would get screwed by this change. But I personally would disable the button to follow a person when that person is already following you. (+ some hover text or popup when clicking the disabled button so you know why exactly it is disabled right now)

pwaller commented 5 years ago

Experiencing the same thing here, myself and the partner have both done "follow to the side", and we are each editing the same file. What happens is that the side goes berserk with scrolling.

This is unfortunate, because this is exactly a useful use case for us: we both want to edit different parts of the same file simultaneously and see what each other are doing.

mewmew commented 5 years ago

re: @lostintangent

That we disallow following someone that is following you?

This is unfortunate, because this is exactly a useful use case for us: we both want to edit different parts of the same file simultaneously and see what each other are doing.

So the suggested work-around to disable following someone who is following you is not great, since this is precisely the use case that we want to have. We both want to use the "follow to the side" simultaneously.

Londovir commented 5 years ago

We just hit this ourselves after discovering this extension via references in the MSDN magazine. It seems like some sort of odd loop is going on when I "follow to the side" my coworker, who does the same to me, and we are in the same file.

It almost seems like both instances of VS Code get into a race to keep their views updated to the other person's scroll position, even though each of the people is following on the side. So, say I have file mine.txt open on my screen, and my friend has mine.txt open on his side, and we're both following each other on the side. When I scroll my primary instance of mine.txt, in theory it should only scroll my friend's side panel to match, and what happens now seems like when it does that, it somehow interprets that scroll on the side as being a primary instance scroll from my friend which I have to have synced to my side view. In reality, my side view should only be following scrolls my friend makes in his primary window, even if he is following my work in that same file.

I wonder if this is the reason why the side panels start bounce scrolling rapidly?

daytonellwanger commented 5 years ago

This should be resolved in our next release! Please let us know if you notice any other strange follow behavior.

rasotoipc commented 5 years ago

I installed Live Share today and tested with a colleague and scroll bar was still jerking. It kept taking back to top of document.

daytonellwanger commented 5 years ago

@rasotoipc , that sounds like a separate issue from the follow loop.

To clarify: you were seeing the scroll bar pulled to the top of the document at random?

rasotoipc commented 5 years ago

When I try to scroll down, it jerks me back to the the top and I cannot get to bottom of document.

daytonellwanger commented 5 years ago

Thanks for reporting! I opened a new issue here to track and assigned to myself, since this sounds different from the follow loop.