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

[ABW-2554] update exception handling to properly show no mnemonic error #618

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

jakub-rdx
Copy link
Contributor

@jakub-rdx jakub-rdx commented Nov 1, 2023

Description

No mnemonic exception was passed as a cause of signature failure, so error handling flow in dapp login was wrong in this scenario.

How to test

Please refer to Jira ticket, there are detailed steps to reproduce.

PR submission checklist

  • I have verified that situation described in the ticket is now handled properly

@jakub-rdx jakub-rdx changed the title update exception handling to properly show no mnemonic error [ABW-2554] update exception handling to properly show no mnemonic error Nov 1, 2023
@jakub-rdx jakub-rdx requested review from micbakos-rdx, giannis-rdx and raf-rdx and removed request for micbakos-rdx November 1, 2023 10:45
@@ -158,6 +162,15 @@ private fun RevealSeedPhraseContent(
)
}
}
if (BuildConfig.DEBUG_MODE) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added debug button to copy whole seed phrase, this is really helpful when trying to input mnemonic quick for testing purposes, for example after backup restoration

Copy link
Contributor

Choose a reason for hiding this comment

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

that's great
thanks! 🙌🏽

@@ -259,17 +259,17 @@ class DAppAuthorizedLoginViewModel @Inject constructor(
if (exception.cause is RadixWalletException.SignatureCancelled) {
return
}
if (exception.cause is ProfileException.NoMnemonic) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is most important change in this PR, rest is just minor renaming

Copy link
Contributor

@giannis-rdx giannis-rdx left a comment

Choose a reason for hiding this comment

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

We must restore the profile and skip the mnemonic in order to test it, right?

@@ -158,6 +162,15 @@ private fun RevealSeedPhraseContent(
)
}
}
if (BuildConfig.DEBUG_MODE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

that's great
thanks! 🙌🏽

@@ -727,7 +727,7 @@ class DAppAuthorizedLoginViewModel @Inject constructor(
sealed interface Event : OneOffEvent {

data object CloseLoginFlow : Event
data class RequestCompletionBiometricPrompt(val requestDuringSigning: Boolean) : Event
data class RequestCompletionBiometricPrompt(val signatureRequired: Boolean) : Event
Copy link
Contributor

Choose a reason for hiding this comment

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

However let's keep it as we have in most of places with the prefix is -> isSignatureRequired.
a renaming is always a welcome improvement!

@jakub-rdx
Copy link
Contributor Author

We must restore the profile and skip the mnemonic in order to test it, right?

yes

Copy link
Contributor

@giannis-rdx giannis-rdx left a comment

Choose a reason for hiding this comment

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

tested and it works

Copy link

sonarcloud bot commented Nov 1, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@jakub-rdx jakub-rdx merged commit a75f9bf into main Nov 1, 2023
6 of 8 checks passed
@jakub-rdx jakub-rdx deleted the fix/ABW-2554-fix-no-mnemonic-prompt branch November 1, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants