Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug logging for Cloud Changes enablement #190764

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,17 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
} else if (shouldAutoResumeOnReload) {
// The application has previously launched via a protocol URL Continue On flow
const hasApplicationLaunchedFromContinueOnFlow = this.storageService.getBoolean(EditSessionsContribution.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, StorageScope.APPLICATION, false);
this.logService.info(`Prompting to enable cloud changes, has application previously launched from Continue On flow: ${hasApplicationLaunchedFromContinueOnFlow}`);

const handlePendingEditSessions = () => {
// display a badge in the accounts menu but do not prompt the user to sign in again
this.logService.info('Showing badge to enable cloud changes in accounts menu...');
this.updateAccountsMenuBadge();
this.pendingEditSessionsContext.set(true);
// attempt a resume if we are in a pending state and the user just signed in
const disposable = this.editSessionsStorageService.onDidSignIn(async () => {
disposable.dispose();
this.logService.info('Showing badge to enable cloud changes in accounts menu succeeded, resuming cloud changes...');
await this.progressService.withProgress(resumeProgressOptions, async (progress) => await this.resumeEditSession(undefined, true, undefined, undefined, progress));
this.storageService.remove(EditSessionsContribution.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, StorageScope.APPLICATION);
this.environmentService.continueOn = undefined;
Expand All @@ -227,8 +230,10 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
) {
// store the fact that we prompted the user
this.storageService.store(EditSessionsContribution.APPLICATION_LAUNCHED_VIA_CONTINUE_ON_STORAGE_KEY, true, StorageScope.APPLICATION, StorageTarget.MACHINE);
this.logService.info('Prompting to enable cloud changes...');
await this.editSessionsStorageService.initialize('read');
if (this.editSessionsStorageService.isSignedIn) {
this.logService.info('Prompting to enable cloud changes succeeded, resuming cloud changes...');
await this.progressService.withProgress(resumeProgressOptions, async (progress) => await this.resumeEditSession(undefined, true, undefined, undefined, progress));
} else {
handlePendingEditSessions();
Expand All @@ -239,6 +244,8 @@ export class EditSessionsContribution extends Disposable implements IWorkbenchCo
) {
handlePendingEditSessions();
}
} else {
this.logService.debug('Auto resuming cloud changes disabled.');
}
}

Expand Down