-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Web console: more robust durable storage setting detection #16493
Web console: more robust durable storage setting detection #16493
Conversation
@@ -89,6 +89,10 @@ export function addOrUpdate<T>(xs: readonly T[], x: T, keyFn: (x: T) => string | | |||
|
|||
// ---------------------------- | |||
|
|||
export function caseInsensitiveEquals(str1: string | undefined, str2: string | undefined): boolean { | |||
return str1?.toLowerCase() === str2?.toLowerCase(); |
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.
This would throw a NPE if str1 or str2 are null, right? If yes, I think we should handle that as well since this is a utility function.
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.
no that is what the ?
before the .
is for. It is essentially doing (str1 ? str1.toLowerCase() : undefined) === (str2 ? str2.toLowerCase() : undefined)
. Added a test case so you can verify
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.
Ah I see, thanks for the clarification!
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.
🚀
Right now the docs tell people to set
"selectDestination": "DURABLESTORAGE"
(which works) but the console check fordurableStorage
. Fix the docs and make the console check more robust.