-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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 Warnings during settings load #2422
Conversation
The start of work on #1348
* Add a ton of tests * Polish the _GetMessageText bits * Add code to check for duplicate profiles * Verify that many warnings work at the same time * comments y'all
</value> | ||
</data> | ||
<data name="DuplicateProfileText" xml:space="preserve"> | ||
<value>Found multiple profiles with the same guid in your profiles - temporarily ignoring duplicates. Make sure each profile's guid is unique. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we capitalize GUID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we do, but at the same time, the key is guid
not GUID
, so IDK. Maybe we should have a wordsmith's opinion @bitcrazed @cinnamon-msft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the projects I've seen follow much of the guidance in Google's JSON Style Guide which states that property names should be camel cased:
{
"thisPropertyIsAnIdentifier": "identifier value"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sooooooooo you're saying we should call it gUID
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bitcrazed This is not a question about our json schema. This is a question about a user-facing error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhhhh - apologies!
In human-text, acronyms formed from the initial letter of each word should be all-caps - GUID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with GUID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this properly propagate error texts up from jsoncpp?
you better believe it does :D |
This is a real failure in x86.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(1) if I change the defaultProfile
to an invalid guid, I get "No profiles were found in your settings.
". Not sure if you want to address that in this PR or open a new issue.
(2) In our dialog box, we should explicitly mention that we're temporarily using the "Windows Terminal default settings" or something to that nature. That way users know what is happening when there is an error. That should probably address my "temporarily" issue below.
…ettings-warnings # Conflicts: # src/cascadia/TerminalApp/App.cpp
|
||
// We don't use the what() method - we want to be able to display | ||
// localizable error messages. Catchers of this exception should use | ||
// _GetErrorText to get the localized exception string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this _GetErrorText
? Also, wouldn't providing a what()
at least help someone figure out what's going on in the debugger moreso than providing nothing even if it's not localized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some placeholder text. I f you really want, we could file a task to try and make that text specific to the exception value
@carlos-zamora yea that is pretty redundant now. I'll try and update that. As far as the reload/duplicate crash, let's file a new issue, since that's not necessarily worse because of this change |
We may want to go less specific and just say “in your configuration file”? |
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Summary of the Pull Request
Adds support for two things: more discrete settings errors that we can detect on load, and discrete warnings we can detect on load.
Errors are things that we might find that cause the settings to be totally invalid. At the moment, there are two such cases:
When we find such an error case, we'll display more specific text in the popup:

Warnings are things that aren't necessarily fatal, but they certainly aren't good. I focused on two cases:
When we find a warning, we'll try to mitigate it, and keep running. We won't save the settings on load, because we'll have likely changed them internally. We'll also display all the warnings to the user, so they can see what they did wrong.

PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
profiles.json
profiles
entirely