Skip to content

List still dirty files when backup fails - #114064

Merged
Matt Bierner (mjbvz) merged 2 commits into
microsoft:masterfrom
mjbvz:backup-fail-file-list
Jan 13, 2021
Merged

Matt Bierner (mjbvz) merged 2 commits into
microsoft:masterfrom
mjbvz:backup-fail-file-list

Conversation

@mjbvz

Copy link
Copy Markdown
Contributor

Fixes #113627

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matt Bierner (@mjbvz) I suggest to implement this inside the showErrorDialog method because there are 2 cases where an error can show: either because backup failed or because save/revert failed and in both cases it would help the user see the name of the editor, right?

So simply check for dirty working copies inside showErrorDialog and if there are, list the names below the error message, is what I suggest.

this.dialogService.show(Severity.Error, msg, [localize('ok', 'OK')], { detail: localize('backupErrorDetails', "Try saving or reverting the dirty editors first and then try again.") });
private showErrorDialog(msg: string, error?: Error, fileList?: string): void {
const advice = localize('backupErrorDetails', "Try saving or reverting the dirty editors first and then try again.");
const detail = fileList ? fileList + '\n' + advice : advice;

ghost Jan 9, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the details part of the dialog should be like this:

Try saving or reverting the dirty editors first and then try again:
<list of editors>

Instead of the other way around?

ghost Jan 9, 2021

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, is it worth including the actual error held in the 'error' variable in the dialog. It is pushed through the log service, but, not part of the dialogue.

@mjbvz

ghost commented Jan 11, 2021

Copy link
Copy Markdown
Contributor Author

Thanks Benjamin Pasero (@bpasero)! I've moved the file list logic into showErrorDialog

For your other suggestion, here's the detail UI with the current change:

Screen Shot 2021-01-11 at 11 25 52 AM

And here's with the detail order swapped:

Screen Shot 2021-01-11 at 11 23 22 AM

I like prefer the current ordering and also think this matches our current 'save all' dialog: #113627 (comment)

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matt Bierner (@mjbvz) I also prefer the first variant where it aligns with the save dialog.

@mjbvz
Matt Bierner (mjbvz) merged commit 68ba207 into microsoft:master Jan 13, 2021
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failure to backup custom editors close veto message should list problem tabs

3 participants