vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Settings sync disabled due to too many requests

Open roblourens opened this issue 1 year ago • 7 comments

I have a few vscode windows open in the background, I haven't touched them in a couple hours. I just noticed that they have this notification: image

Here's the log userDataSync.log

roblourens avatar Sep 20 '22 18:09 roblourens

I see this in the "sync data"

image

The most recent:

image

Looking at the recent UI State sync activity, it seems like that boolean is just switching from true to false and back. So something is causing that to be stuck in a loop I guess.

roblourens avatar Sep 20 '22 18:09 roblourens

@Tyriar and @jrieken also saw the same. Can you please confirm from your settings sync data view if you see the same boolean change in the global state?

sandy081 avatar Sep 20 '22 20:09 sandy081

I get this every time after restarting vscode, so settings sync is totally broken now.

roblourens avatar Sep 20 '22 23:09 roblourens

I suspect some global state is misbehaving. I will sync with you directly.

sandy081 avatar Sep 21 '22 07:09 sandy081

Ok, I am also seeing this.

sandy081 avatar Sep 21 '22 07:09 sandy081

This seems to happen when there are at least more than one window opened. Both windows are updating the global state (pinned panels) with a different value.

sandy081 avatar Sep 21 '22 07:09 sandy081

This bug got surfaced because of the following change and revealed a can of worms in the code

https://github.com/microsoft/vscode/commit/2ae5bc69802cf6042f5f435f6d247379aeca2181#diff-bb39d7c36591ac930515684707ed163977cb7cd81bef278f2633b471397c3ad0R828-R849

https://github.com/microsoft/vscode/commit/2ae5bc69802cf6042f5f435f6d247379aeca2181#diff-bb39d7c36591ac930515684707ed163977cb7cd81bef278f2633b471397c3ad0R886-R1063

In brief, this change added syncStatus context key to the action contributed to ViewContainerTitle Menu. This triggered all view containers in panel area to update their title areas whenever the above context changes. Updating the panel title area recomputes the panels cache. This cache is different in every window because of comments panel visibility is window specific. Here is the sequence of actions caused this

  1. Window 1: updates comments panel visibility state to true in storage
  2. Settings Sync is triggered and syncStatus context changes its state
  3. Window 2: Panel's state is asked to recompute because of syncStatus change and updates the comment panel visibility state to false in storage
  4. Settings Sync is triggered and syncStatus context changes its state
  5. Window 1: Panel's state is asked to recompute because of CONTEXT_SYNC_STATE change and updates the comment panel visibility state to false in storage
  6. Cycle 2-5

There are following issues here

  1. Change to syncStatus context shall not trigger recomputing panel's state. Both are completely unrelated.
  2. Every window shall compute the same panel state. Window 1 and Window 2 not showing the comments panel is not user choice. So visibility in the state shall be user's value.

I am pushing a tactical fix to unblock until fixing above issues - Break the above cycle by removing syncStatus on actions contributed to ViewContainerTitle

sandy081 avatar Sep 21 '22 10:09 sandy081

Closing it as the original issue got fixed. Created a follow up issue https://github.com/microsoft/vscode/issues/162019 for improvements

sandy081 avatar Sep 27 '22 17:09 sandy081

Have not seen this again, although it sounds like @rebornix just saw this - not sure if the same thing

roblourens avatar Sep 29 '22 01:09 roblourens

Thanks for verifying. What @rebornix saw is not same as this.

sandy081 avatar Sep 29 '22 07:09 sandy081