userDataAutoSyncService.ts ×6

Frontier kind: Joint frontier

unlabeled · c_7c36041c383e

1 test · 28317 LOC · 134 files · introduces 1 test · 28 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges28 lines · 3 files
Tests
1 test

Contains — complete concept membership

All code (extent)
4873 ranges28317 lines · 134 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

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

3 files ranked by introduced lines: 28 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/userDataSync/common/userDataAutoSyncService.ts 24 introduced LOC · 6 ranges

Open complete file

239 this.logService.info('[AutoSync] Turned off sync because sync is turned off in the cloud');
240 }
242 > // Exceeded Rate Limit on Client
243 > else if (userDataSyncError.code === UserDataSyncErrorCode.LocalTooManyRequests) {
244 this.suspendUntilRestart = true;
245 this.logService.info('[AutoSync] Suspended sync because of making too many requests to server');
246 this.updateAutoSync();
247 }
249 > // Exceeded Rate Limit on Server
250 > else if (userDataSyncError.code === UserDataSyncErrorCode.TooManyRequests) {
251 > await this.turnOff(false, true /* force soft turnoff on error */,
252 > true /* do not disable machine because disabling a machine makes request to server and can fail with TooManyRequests */);
253 > this.disableMachineEventually();
254 > this.logService.info('[AutoSync] Turned off sync because of making too many requests to server');
255 > }
256
257 // Method Not Found
310
311 private async disableMachineEventually(): Promise<void> {
312 > this.storageService.store(disableMachineEventuallyKey, true, StorageScope.APPLICATION, StorageTarget.MACHINE); userDataAutoSyncService.ts
313 > await timeout(1000 * 60 * 10);
314 >
315 > // Return if got stopped meanwhile.
316 > if (!this.hasToDisableMachineEventually()) {
317 return;
318 }
320 > this.stopDisableMachineEventually();
321 >
322 > // disable only if sync is disabled
323 > if (!this.userDataSyncEnablementService.isEnabled() && this.userDataSyncAccountService.account) {
324 await this.userDataSyncMachinesService.removeCurrentMachine();
325 }
327
328 private hasToDisableMachineEventually(): boolean {
331
332 private stopDisableMachineEventually(): void {
333 > this.storageService.remove(disableMachineEventuallyKey, StorageScope.APPLICATION); userDataAutoSyncService.ts
334 > }
335
336 private sources: string[] = [];
src/vs/platform/userDataSync/common/abstractSynchronizer.ts 2 introduced LOC · 2 ranges

Open complete file

539 await this.fileService.del(this.lastSyncResource);
540 } catch (error) {
541 > if (toFileOperationResult(error) !== FileOperationResult.FILE_NOT_FOUND) { abstractSynchronizer.ts
542 this.logService.error(error);
543 }
545 }
546
src/vs/platform/userDataSync/common/userDataSyncStoreService.ts 2 introduced LOC · 1 range

Open complete file

674 throw new UserDataSyncStoreError(`${options.type} request '${url}' failed because of too many requests (429).`, url, UserDataSyncErrorCode.TooManyRequestsAndRetryAfter, context.res.statusCode, operationId);
675 } else {
676 > throw new UserDataSyncStoreError(`${options.type} request '${url}' failed because of too many requests (429).`, url, UserDataSyncErrorCode.TooManyRequests, context.res.statusCode, operationId); userDataSyncStoreService.ts
677 > }
678 }
679