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

Refactor: a review screen for recovery attempts #4200

Merged
merged 10 commits into from
Sep 26, 2024
Merged

Conversation

katspaugh
Copy link
Member

@katspaugh katspaugh commented Sep 18, 2024

What it solves

Resolves #4188

Screenshot 2024-09-20 at 11 03 03

How this PR fixes it

Adds a simple review screen similar to the Spening Limit review component.

How to test it

  • Set up recovery
  • Initiate a recovery tx
  • Confirm/execute the recovery tx

Copy link

github-actions bot commented Sep 18, 2024

Copy link

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Sep 18, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 954.63 KB (🟡 +149 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Copy link

github-actions bot commented Sep 18, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.12% (-0.09% 🔻)
11992/15350
🔴 Branches
58.24% (-0.01% 🔻)
3086/5299
🟡 Functions
65.14% (-0.14% 🔻)
1889/2900
🟡 Lines
79.63% (-0.09% 🔻)
10823/13591
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / useAsync.ts
64.29% (-35.71% 🔻)
90.91% (-9.09% 🔻)
60% (-40% 🔻)
65% (-35% 🔻)
🔴
... / index.ts
11.32% (-0.44% 🔻)
100% 0%
22.22% (-0.85% 🔻)

Test suite run success

1484 tests passing in 203 suites.

Report generated by 🧪jest coverage report action from a15acaf

trackError(Errors._812, e)
setSubmitError(err)
}
setTxFlow(<RecoveryAttemptFlow params={recovery} />)
Copy link
Contributor

Choose a reason for hiding this comment

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

Its not part of this PR, but just to bring one idea if it wasn't noticed yet:

It would be nice if we could change the way how we set the current transaction flow component, like setting a enum on the state or any other primitive value instead of the component call would save us some undesired reconciliations and re-renders because react doesn't memoize non-primitive states.

Copy link

github-actions bot commented Sep 19, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Comment on lines 76 to 78
<FieldsGrid title="Initiated by">
<EthHashInfo address={item.address} showAvatar hasExplorer showName />
</FieldsGrid>
Copy link
Member

Choose a reason for hiding this comment

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

I would expect to see the recoverer address here (the wallet that initiated this recovery attempt) but item.address is the contract address of the delay modifier.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, good catch.

Copy link
Member

Choose a reason for hiding this comment

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

item.executor seems to be the recoverer address

Copy link
Member

Choose a reason for hiding this comment

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

We could even include the validity time since its part of item i.e. say Confirm or reject this transaction until 20.11.2024 or if it never expires i.e. item.expiresAt is null we could say Confirm or reject this transaction

@usame-algan
Copy link
Member

I just noticed that it is possible to change the nonce of the transaction even though it is already queued. Can we make it a read-only field?
Screenshot 2024-09-20 at 10 33 13

@katspaugh
Copy link
Member Author

@usame-algan good catch, I've added hideNonce as it's a module transaction.

Screenshot 2024-09-20 at 11 03 03

Copy link
Member

@usame-algan usame-algan left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@francovenica
Copy link
Contributor

Minor issue.
The tx status still shows how many confirmations are needed for this tx to go through, even tho only the current owner has to sign and execute it.
image

For comparison, you can see how in spending limits, the amount of confirmations go away when the option is selected. This is the same case
transaction status+

@katspaugh
Copy link
Member Author

Fixed ✅

Screenshot 2024-09-26 at 10 33 20

@francovenica
Copy link
Contributor

Looks good!

@katspaugh katspaugh merged commit 0e3a828 into dev Sep 26, 2024
15 checks passed
@katspaugh katspaugh deleted the review-recovery branch September 26, 2024 12:57
@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Tx confirmation screen for Recovery execution
4 participants