-
Notifications
You must be signed in to change notification settings - Fork 0
LocalContainer not adhering to specifications #48
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
base: main
Are you sure you want to change the base?
Conversation
Use correct encoding and creation of clientDataJson
|
Executing the test locally (revolutionary concept): I.e. someone from the maintainers (@tladesignz, or @jessevanmuijden maybe?) need to see how to fix the frontend requiring TrustedHTML in combination with adding the debug icon to the dom. Good luck. |
| if (secureStore.containsAlias(alias)) { | ||
| secureStore.deleteEntry(alias) | ||
| } else { | ||
| failureCallback(IllegalStateException("Credential alias nor found.")) | ||
| } |
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.
| if (secureStore.containsAlias(alias)) { | |
| secureStore.deleteEntry(alias) | |
| } else { | |
| failureCallback(IllegalStateException("Credential alias nor found.")) | |
| } | |
| if (!secureStore.containsAlias(alias)) { | |
| failureCallback(IllegalStateException("Credential alias nor found.")) | |
| } | |
| secureStore.deleteEntry(alias) |
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 am not sure about this one: It looks like you'd always delete an entry, if it exists or not.
(Also just noticed a typo in the original code: nor should probably be not.)
| if (filename !in context.fileList()) { | ||
| // no delete necessary | ||
| failureCallback(IllegalStateException("File $filename not found.")) | ||
| } else { | ||
| if (context.deleteFile(filename)) { | ||
| successCallback() | ||
| } else { | ||
| failureCallback(RuntimeException("Failed to delete $filename file.")) | ||
| } | ||
| } |
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.
| if (filename !in context.fileList()) { | |
| // no delete necessary | |
| failureCallback(IllegalStateException("File $filename not found.")) | |
| } else { | |
| if (context.deleteFile(filename)) { | |
| successCallback() | |
| } else { | |
| failureCallback(RuntimeException("Failed to delete $filename file.")) | |
| } | |
| } | |
| if (filename !in context.fileList()) { | |
| // no delete necessary | |
| failureCallback(IllegalStateException("File $filename not found.")) | |
| } | |
| if (!context.deleteFile(filename)) { | |
| failureCallback(RuntimeException("Failed to delete $filename file.")) | |
| } | |
| successCallback() |
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.
🤔
Wouldn't that open the possibility to call the failureCallback() and then the successCallback() when the file doesn't exist.
Also the failure callback would get invoked twice if the file doesn't exist: First on check, and then when the non existant file is tried to get deleted...
The idea for me is that there shouldn't be an option where both callbacks can get called (or one callback gets called multiple times).
mariobodemann
left a comment
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 am not sure if I get the intent of the proposed changes. See inline for detailed feedback.
| if (filename !in context.fileList()) { | ||
| // no delete necessary | ||
| failureCallback(IllegalStateException("File $filename not found.")) | ||
| } else { | ||
| if (context.deleteFile(filename)) { | ||
| successCallback() | ||
| } else { | ||
| failureCallback(RuntimeException("Failed to delete $filename file.")) | ||
| } | ||
| } |
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.
🤔
Wouldn't that open the possibility to call the failureCallback() and then the successCallback() when the file doesn't exist.
Also the failure callback would get invoked twice if the file doesn't exist: First on check, and then when the non existant file is tried to get deleted...
The idea for me is that there shouldn't be an option where both callbacks can get called (or one callback gets called multiple times).
| if (secureStore.containsAlias(alias)) { | ||
| secureStore.deleteEntry(alias) | ||
| } else { | ||
| failureCallback(IllegalStateException("Credential alias nor found.")) | ||
| } |
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 am not sure about this one: It looks like you'd always delete an entry, if it exists or not.
(Also just noticed a typo in the original code: nor should probably be not.)
|
@mariobodemann the proposed changes were just a suggestion to replace nested if statements with early returns for readability. |
|
Ah, I get the intent. But that wouldn't work. In your suggestions you'll call the callbacks but you aren't exiting the function. You'd need an explicit |
While testing the wrapper we found that the initial implementation needed some more love.
This PR fixes cruicial local container creation, and adds love.