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

fix: collateral password issue [LW-11953] #1584

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

greatertomi
Copy link
Contributor

@greatertomi greatertomi commented Dec 9, 2024

Checklist

  • JIRA - LW-11953
  • Proper tests implemented
  • Screenshots added.

Proposed solution

Adjusted the flow to submit transaction before clearing password

@greatertomi greatertomi requested a review from a team as a code owner December 9, 2024 20:48
@pczeglik-iohk
Copy link
Contributor

pczeglik-iohk commented Dec 9, 2024

Allure Report

allure-report-publisher generated test report!

processReports: ✅ test report for f3a977c0

passed failed skipped flaky total result
Total 32 0 4 0 36

@pczeglik-iohk pczeglik-iohk changed the title fix: collateral password issue fix: collateral password issue [LW-11953] Dec 10, 2024
@@ -44,6 +44,11 @@ export const EnterPassword: VFC<EnterPasswordProps> = ({
const icon = mapOfWalletTypeIconProperties[kind];

const next = () => {
if (!password.value) {
console.error('Password is undefined');
Copy link
Contributor

@pczeglik-iohk pczeglik-iohk Dec 10, 2024

Choose a reason for hiding this comment

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

console.error is commonly used in the lace codebase, so I think it's fine.

But in the same time I wonder if this is the way we should handle it. Especially as we have Sentry in place.

Maybe we do not need to pollute users console with application error, but report them to Sentry, so in this case throw new Error('EnterPassword: password is undefined') maybe a bit better.

It can be as it is, no need to change it right now, but it's worth exploring this area in upcoming weeks, so we can refactor.

Copy link
Contributor

Choose a reason for hiding this comment

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

We need to be careful with throwing errors in react code, as it might unmount the whole app, as we don't have any error boundary as far as I know. The disappearing application would be a far more severe issue than the benefit of catching the problem with sentry.

Copy link
Contributor

Choose a reason for hiding this comment

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

there are methods like captureException and captureMessage in Sentry https://docs.sentry.io/platforms/javascript/guides/react/usage/
we may be interested to use. We could wrap it into some abstraction layer so we are provider agnostic etc

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely worth exploring. I just want to mention that I would prefer to have a seamless implementation instead of some function that I need to explicitly call in order to register the exception in sentry. I would like to stick to native mechanism - just throw an error that would be catched at some higher level and reported, instead of remembering that I need to pass it to some function.

Copy link
Contributor

@pczeglik-iohk pczeglik-iohk left a comment

Choose a reason for hiding this comment

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

Thank you @greatertomi Code looks good.

There is only one decision to be made for the future we can ignore right now.

@greatertomi greatertomi force-pushed the fix/lw-11953-collateral-signing branch from 2dce5bf to f3a977c Compare December 10, 2024 11:56
Copy link

sonarcloud bot commented Dec 10, 2024

@greatertomi greatertomi merged commit 594bbd0 into main Dec 10, 2024
30 checks passed
@greatertomi greatertomi deleted the fix/lw-11953-collateral-signing branch December 10, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants