userDataSyncService.ts ×9

Frontier kind: Code frontier

unlabeled · c_ac25465bf20a

11 tests · 28070 LOC · 134 files · introduces 0 tests · 26 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges26 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4799 ranges28070 lines · 134 files · Browse complete extent
All tests (intent)
11 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 26 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/userDataSync/common/userDataSyncService.ts 23 introduced LOC · 9 ranges

Open complete file

394
395 async hasPreviouslySynced(): Promise<boolean> {
396 > const result = await this.performAction(this.userDataProfilesService.defaultProfile, async synchronizer => { userDataSyncService.ts
397 > if (await synchronizer.hasPreviouslySynced()) {
398 return true;
399 }
400 return undefined;
402 > return !!result;
403 > }
404
405 async reset(): Promise<void> {
532
533 private async performAction<T>(profile: IUserDataProfile, action: (synchroniser: IUserDataSynchroniser) => Promise<T | undefined>): Promise<T | null> {
534 > const disposables = new DisposableStore(); userDataSyncService.ts
535 > try {
536 > const activeProfileSyncronizer = this.activeProfileSynchronizers.get(profile.id);
537 > if (activeProfileSyncronizer) {
538 const result = await this.performActionWithProfileSynchronizer(activeProfileSyncronizer[0], action, disposables);
539 return isUndefined(result) ? null : result;
548 const userDataProfileManifestSynchronizer = disposables.add(this.instantiationService.createInstance(UserDataProfilesManifestSynchroniser, profile, undefined));
549 const manifest = await this.userDataSyncStoreService.manifest(null);
550 > const syncProfiles = (await userDataProfileManifestSynchronizer.getRemoteSyncedProfiles(manifest?.latest?.profiles ?? null)) || []; userDataSyncService.ts
551 > const syncProfile = syncProfiles.find(syncProfile => syncProfile.id === profile.id);
552 > if (syncProfile) {
553 const profileSynchronizer = disposables.add(this.instantiationService.createInstance(ProfileSynchronizer, profile, syncProfile.collection));
554 const result = await this.performActionWithProfileSynchronizer(profileSynchronizer, action, disposables);
557
558 return null;
559 > } finally { userDataSyncService.ts
560 > disposables.dispose();
561 > }
562 > }
563
564 private async performActionWithProfileSynchronizer<T>(profileSynchronizer: ProfileSynchronizer, action: (synchroniser: IUserDataSynchroniser) => Promise<T | undefined>, disposables: DisposableStore): Promise<T | undefined> {
565 > const allSynchronizers = [...profileSynchronizer.enabled, ...profileSynchronizer.disabled.reduce<(IUserDataSynchroniser & IDisposable)[]>((synchronizers, syncResource) => { userDataSyncService.ts
566 if (syncResource !== SyncResource.WorkspaceState) {
567 synchronizers.push(disposables.add(profileSynchronizer.createSynchronizer(syncResource)));
568 }
569 return synchronizers;
570 > }, [])]; userDataSyncService.ts
571 > for (const synchronizer of allSynchronizers) {
572 > const result = await action(synchronizer);
573 > if (!isUndefined(result)) {
574 return result;
575 }
577 return undefined;
579
580 private setStatus(status: SyncStatus): void {
src/vs/platform/userDataSync/common/abstractSynchronizer.ts 3 introduced LOC · 1 range

Open complete file

509
510 async hasPreviouslySynced(): Promise<boolean> {
511 > const lastSyncData = await this.getLastSyncUserData(); abstractSynchronizer.ts
512 > return !!lastSyncData && lastSyncData.syncData !== null /* `null` sync data implies resource is not synced */;
513 > }
514
515 protected async resolvePreviewContent(uri: URI): Promise<string | null> {