Change:
have insiders with settings sync enabled add exploration build to the sync select replace local when prompted so that exploration because just like insiders over time insiders UI state gets ruined, e.g the side bar is populated with views I have carefully hidden and rearranged
This is caused due to the dependency between two states and . Values of both states changed together from outside Change event for first state is triggered. Updating to this change can cause view container changes like (registering or deregistering) This triggers internal change events to update pinned viewlets Updating pinned viewlets is updating the stored value for second state Bug is caused at the last step -pinned viewlets state is getting overriden without refreshing its in-memory state.
How would this be verified?
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!
Since it cannot be reproduced easily, I would ask to verify this.
the steps are as easy as described in or the description of this issue. use settings sync onboard another machine :bug: view state of the main machine get's broken: views reappear, views are reordered etcpp
Can you please verify this? I believe this depends on some pre-existing state therefore not everyone can reproduce. This state is not trivial to set up. Since you have this state already, it might be easier for you to verify.

Discussion:
setCompositeBarItems(items: ICompositeBarItem[]): void { this.model.setItems(items); <del> this.updateCompositeSwitcher(); </del> <ins> this.updateCompositeSwitcher(true); </ins> } getPinnedComposites(): ICompositeBarItem[] {

} } <del> private updateCompositeSwitcher(): void { </del> <ins> private updateCompositeSwitcher(donotTrigger?: boolean): void { </ins> const compositeSwitcherBar = this.compositeSwitcherBar; if (!compositeSwitcherBar || !this.dimension) { return; // We have not been rendered yet so there is nothing to update.

compositeSwitcherBar.push(this.compositeOverflowAction, { label: false, icon: true }); } <del> this._onDidChange.fire(); </del> <ins> if (!donotTrigger) { this._onDidChange.fire(); } </ins> } private getOverflowingComposites(): { id: string; name?: string }[] {

import { IColorTheme } from '../../../platform/theme/common/themeService.js'; import { CompositeBar, ICompositeBarItem, CompositeDragAndDrop } from './compositeBar.js'; import { Dimension, createCSSRule, asCSSUrl, isMouseEvent } from '../../../base/browser/dom.js'; <del> import { IStorageService, StorageScope, StorageTarget, IProfileStorageValueChangeEvent } from '../../../platform/storage/common/storage.js'; </del> <ins> import { IStorageService, StorageScope, StorageTarget } from '../../../platform/storage/common/storage.js'; </ins> import { IExtensionService } from '../../services/extensions/common/extensions.js'; import { URI, UriComponents } from '../../../base/common/uri.js'; import { ToggleCompositePinnedAction, ICompositeBarColors, IActivityHoverOptions, ToggleCompositeBadgeAction, CompositeBarAction, ICompositeBar, ICompositeBarActionItem } from './compositeBarActions.js';

return; } this.onDidRegisterExtensions(); <del> this._register(this.compositeBar.onDidChange(() => this.saveCachedViewContainers())); this._register(this.storageService.onDidChangeValue(StorageScope.PROFILE, this.options.pinnedViewContainersKey, this._store)(e => this.onDidPinnedViewContainersStorageValueChange(e))); </del> <ins> this._register(this.compositeBar.onDidChange(() => { this.updateCompositeBarItemsFromStorage(true); this.saveCachedViewContainers(); })); this._register(this.storageService.onDidChangeValue(StorageScope.PROFILE, this.options.pinnedViewContainersKey, this._store)(() => this.updateCompositeBarItemsFromStorage(false))); </ins> }); }

return this.viewDescriptorService.getViewContainersByLocation(this.location); } <del> private onDidPinnedViewContainersStorageValueChange(e: IProfileStorageValueChangeEvent): void { if (this.pinnedViewContainersValue !== this.getStoredPinnedViewContainersValue() /* This checks if current window changed the value or not */) { this._placeholderViewContainersValue = undefined; this._pinnedViewContainersValue = undefined; this._cachedViewContainers = undefined; </del> <ins> private updateCompositeBarItemsFromStorage(retainExisting: boolean): void { if (this.pinnedViewContainersValue === this.getStoredPinnedViewContainersValue()) { return; } </ins> <del> const newCompositeItems: ICompositeBarItem[] = []; const compositeItems = this.compositeBar.getCompositeBarItems(); </del> <ins> this._placeholderViewContainersValue = undefined; this._pinnedViewContainersValue = undefined; this._cachedViewContainers = undefined; </ins> <del> for (const cachedViewContainer of this.cachedViewContainers) { newCompositeItems.push({ id: cachedViewContainer.id, name: cachedViewContainer.name, order: cachedViewContainer.order, pinned: cachedViewContainer.pinned, visible: cachedViewContainer.visible && !!this.getViewContainer(cachedViewContainer.id), }); } </del> <ins> const newCompositeItems: ICompositeBarItem[] = []; const compositeItems = this.compositeBar.getCompositeBarItems(); </ins> <del> for (const viewContainer of this.getViewContainers()) { // Add missing view containers if (!newCompositeItems.some(({ id }) => id === viewContainer.id)) { const index = compositeItems.findIndex(({ id }) => id === viewContainer.id); if (index !== -1) { const compositeItem = compositeItems[index]; newCompositeItems.splice(index, 0, { id: viewContainer.id, name: typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value, order: compositeItem.order, pinned: compositeItem.pinned, visible: compositeItem.visible, }); } else { newCompositeItems.push({ id: viewContainer.id, name: typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value, order: viewContainer.order, pinned: true, visible: !this.shouldBeHidden(viewContainer), }); } </del> <ins> for (const cachedViewContainer of this.cachedViewContainers) { newCompositeItems.push({ id: cachedViewContainer.id, name: cachedViewContainer.name, order: cachedViewContainer.order, pinned: cachedViewContainer.pinned, visible: cachedViewContainer.visible && !!this.getViewContainer(cachedViewContainer.id), }); } for (const viewContainer of this.getViewContainers()) { // Add missing view containers if (!newCompositeItems.some(({ id }) => id === viewContainer.id)) { const index = compositeItems.findIndex(({ id }) => id === viewContainer.id); if (index !== -1) { const compositeItem = compositeItems[index]; newCompositeItems.splice(index, 0, { id: viewContainer.id, name: typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value, order: compositeItem.order, pinned: compositeItem.pinned, visible: compositeItem.visible, }); } else { newCompositeItems.push({ id: viewContainer.id, name: typeof viewContainer.title === 'string' ? viewContainer.title : viewContainer.title.value, order: viewContainer.order, pinned: true, visible: !this.shouldBeHidden(viewContainer), }); </ins> } } <ins> } </ins> <del> this.compositeBar.setCompositeBarItems(newCompositeItems); </del> <ins> if (retainExisting) { for (const compositeItem of compositeItems) { const newCompositeItem = newCompositeItems.find(({ id }) => id === compositeItem.id); if (!newCompositeItem) { newCompositeItems.push(compositeItem); } } </ins> } <ins> this.compositeBar.setCompositeBarItems(newCompositeItems); </ins> } private saveCachedViewContainers(): void {