Change:
Steps to Reproduce: Machine A - Create a profile named Empty and sync Machine B - Turn on Sync and wait until Empty profile is synced on to this machine. Machine B - Quit VS Code - to make sure it is not syncing actively. Machine A - Delete Empty Profile and wait a minute. Create Empty named profile again and sync Machine B - Open VS Code and wait for sync to run. Machine B - Deletes Empty profile and syncs which causes Empty profile to be deleted on Machine A. This scenario keeps happening to me and appears to happen when I revisit a different machine environment. It just reproduced this morning. On my primary machine, I set up a new profile called "Notes". I did all sorts of customization things were working fine until I opened my mac (secondary machine) for the first time in a few weeks. Looking at the sync longs, it the mac sync overrode my profiles on the remote which then was synced down and removed my profile on my primary machine.
Not sure the cause, are we syncing profiles differently to other resources? Also if we are not yet tracking the history of an entire deleted profile we should probably be doing that, and maybe requiring a confirmation when a local profile is deleted via a sync since it's so destructive. Marked important as it's a data loss issue.
The same thing happened to me. I have two devices, and on each one of them I have a couple of profiles and I'm using "default" on both. Now I did following: PC, enable Settings Sync macOS, enable Settings Sync Came back to PC. The profiles from macOS showed up in VS Code. In an hour, all of a sudden all my settings/keybindings werechanged in the default profile Here are the logs From what I read they got deleted. Not it's default profile.
So this might be a bug? I thought it was a design choice to discourage me from reaching around the API into unexposed configuration files? I was initially attempting to share/bundle/distribute vscode Profile configs/keybindings/etc along with my repo/code - but when I clone down the repo to a fresh location, and open vscode (mounted onto the respective and from my repo) it immediately deletes all my Profiles and configs that I committed to said dirs from my repo . I assume it's unhappy because the configs are not it's own? I'm aware that what I'm trying to do here is probably way out of scope & unsafe - I'm just ‍experimenting - which is why I then opted to just write an extension (still in progress / not published) to get around all the (probably more security conscious) API limitations

Discussion:
try { const existing = this.profiles.find(p => p.name === name || p.id === id); if (existing) { <del> return existing; </del> <ins> throw new Error(`Profile with ${name} name already exists`); </ins> } const profile = toUserDataProfile(id, name, joinPath(this.profilesHome, id), this.profilesCacheHome, options, this.defaultProfile);

if (localChange !== Change.None) { await this.backupLocal(stringifyLocalProfiles(this.getLocalUserDataProfiles(), false)); <del> const promises: Promise<any>[] = []; for (const profile of local.added) { promises.push((async () => { this.logService.trace(`${this.syncResourceLogLabel}: Creating '${profile.name}' profile...`); await this.userDataProfilesService.createProfile(profile.id, profile.name, { shortName: profile.shortName, icon: profile.icon, useDefaultFlags: profile.useDefaultFlags }); this.logService.info(`${this.syncResourceLogLabel}: Created profile '${profile.name}'.`); })()); } for (const profile of local.removed) { promises.push((async () => { this.logService.trace(`${this.syncResourceLogLabel}: Removing '${profile.name}' profile...`); await this.userDataProfilesService.removeProfile(profile); this.logService.info(`${this.syncResourceLogLabel}: Removed profile '${profile.name}'.`); })()); } for (const profile of local.updated) { </del> <ins> await Promise.all(local.removed.map(async profile => { this.logService.trace(`${this.syncResourceLogLabel}: Removing '${profile.name}' profile...`); await this.userDataProfilesService.removeProfile(profile); this.logService.info(`${this.syncResourceLogLabel}: Removed profile '${profile.name}'.`); })); await Promise.all(local.added.map(async profile => { this.logService.trace(`${this.syncResourceLogLabel}: Creating '${profile.name}' profile...`); await this.userDataProfilesService.createProfile(profile.id, profile.name, { shortName: profile.shortName, icon: profile.icon, useDefaultFlags: profile.useDefaultFlags }); this.logService.info(`${this.syncResourceLogLabel}: Created profile '${profile.name}'.`); })); await Promise.all(local.updated.map(async profile => { </ins> const localProfile = this.userDataProfilesService.profiles.find(p => p.id === profile.id); if (localProfile) { <del> promises.push((async () => { this.logService.trace(`${this.syncResourceLogLabel}: Updating '${profile.name}' profile...`); await this.userDataProfilesService.updateProfile(localProfile, { name: profile.name, shortName: profile.shortName, icon: profile.icon, useDefaultFlags: profile.useDefaultFlags }); this.logService.info(`${this.syncResourceLogLabel}: Updated profile '${profile.name}'.`); })()); </del> <ins> this.logService.trace(`${this.syncResourceLogLabel}: Updating '${profile.name}' profile...`); await this.userDataProfilesService.updateProfile(localProfile, { name: profile.name, shortName: profile.shortName, icon: profile.icon, useDefaultFlags: profile.useDefaultFlags }); this.logService.info(`${this.syncResourceLogLabel}: Updated profile '${profile.name}'.`); </ins> } else { this.logService.info(`${this.syncResourceLogLabel}: Could not find profile with id '${profile.id}' to update.`); } <del> } await Promise.all(promises); </del> <ins> })); </ins> } if (remoteChange !== Change.None) {