abstractSynchronizer.ts ×10

Frontier kind: Code frontier

unlabeled · c_aab49ba75afb

182 tests · 24972 LOC · 133 files · introduces 0 tests · 23 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges23 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
3967 ranges24972 lines · 133 files · Browse complete extent
All tests (intent)
182 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.

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

src/vs/platform/userDataSync/common/abstractSynchronizer.ts 23 introduced LOC · 10 ranges

Open complete file

598 return null;
599 }
601 > const lastSyncUserDataState: ILastSyncUserDataState = JSON.parse(storedLastSyncUserDataStateContent);
602 > const resourceSyncStateVersion = this.userDataSyncEnablementService.getResourceSyncStateVersion(this.resource);
603 this.hasSyncResourceStateVersionChanged = !!lastSyncUserDataState.version && !!resourceSyncStateVersion && lastSyncUserDataState.version !== resourceSyncStateVersion;
604 if (this.hasSyncResourceStateVersionChanged) {
607 return null;
608 }
610 > let syncData: ISyncData | null | undefined = undefined;
611 >
612 > // Get Last Sync Data from Local
613 > let retrial = 1;
614 while (syncData === undefined && retrial++ < 6 /* Retry 5 times */) {
616 > const lastSyncStoredRemoteUserData = await this.readLastSyncStoredRemoteUserData();
617 if (lastSyncStoredRemoteUserData) {
618 if (lastSyncStoredRemoteUserData.ref === lastSyncUserDataState.ref) {
623 }
624 break;
625 > } catch (error) { abstractSynchronizer.ts
626 if (error instanceof FileOperationError && error.fileOperationResult === FileOperationResult.FILE_NOT_FOUND) {
627 this.logService.info(`${this.syncResourceLogLabel}: Last sync resource does not exist locally.`);
634 }
635 }
637 >
638 > // Get Last Sync Data from Remote
639 > if (syncData === undefined) {
640 try {
641 const content = await this.userDataSyncStoreService.resolveResourceContent(this.resource, lastSyncUserDataState.ref, this.collection, this.syncHeaders);
650 }
651 }
653 > // Last Sync Data Not Found
654 > if (syncData === undefined) {
655 return null;
656 }
683
684 private async readLastSyncStoredRemoteUserData(): Promise<IRemoteUserData | undefined> {
685 > const content = (await this.fileService.readFile(this.lastSyncResource)).value.toString(); abstractSynchronizer.ts
686 try {
687 > const lastSyncStoredRemoteUserData = content ? JSON.parse(content) : undefined; abstractSynchronizer.ts
688 > if (isRemoteUserData(lastSyncStoredRemoteUserData)) {
689 return lastSyncStoredRemoteUserData;
690 }
691 > } catch (e) { abstractSynchronizer.ts
692 this.logService.error(e);
693 }
694 return undefined;
696
697 private async writeLastSyncStoredRemoteUserData(lastSyncRemoteUserData: IRemoteUserData): Promise<void> {