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: allow cancellation after expiration #2902

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

iamacook
Copy link
Member

What it solves

Resolves ability to cancel recovery attempts after expiration

How this PR fixes it

The disable logic has been altered to only take the expiration into account when not connected as an owner, as well as adjusting the information about cancellation throughout the app.

How to test it

Observe cancellation is always possible as an owner, wheras if not an owner only after expiration.

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

@iamacook iamacook requested a review from usame-algan November 28, 2023 13:30
@iamacook iamacook self-assigned this Nov 28, 2023
Copy link

github-actions bot commented Nov 28, 2023

Branch preview

✅ Deploy successful!

https://recovery_cancel_period--walletweb.review-wallet-web.5afe.dev

@@ -32,7 +32,7 @@ const headCells = [
label: (
<>
Recovery delay{' '}
<Tooltip title="You can cancel any recovery attempt when it is not needed or wanted within the delay period.">
<Tooltip title="You can cancel any recovery attempt when it is not needed or wanted.">
Copy link
Member Author

Choose a reason for hiding this comment

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

We should extract these to a constant as they are the same throughout the app but I'd suggest so in a separate PR to avoid inflating the scope of this.

Copy link

github-actions bot commented Nov 28, 2023

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 Nov 28, 2023

📦 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 1.52 MB (🟡 +8.41 KB)
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!

Twenty-nine Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/addOwner 3.5 KB (🟢 -20 B) 1.52 MB
/apps 34.59 KB (🟢 -240 B) 1.55 MB
/apps/custom 27.12 KB (🟢 -239 B) 1.55 MB
/apps/open 26.78 KB (🟡 +59 B) 1.55 MB
/balances 26.52 KB (🔴 +5.7 KB) 1.55 MB
/balances/nfts 18.68 KB (🟡 +47 B) 1.54 MB
/cookie 8.88 KB (🔴 +2.56 KB) 1.53 MB
/home 39.95 KB (🔴 +13.06 KB) 1.56 MB
/imprint 1.41 KB (🟢 -14 B) 1.52 MB
/licenses 5.13 KB (🟢 -15 B) 1.53 MB
/new-safe/create 11.83 KB (🟡 +8 B) 1.53 MB
/privacy 15.87 KB (🔴 +3.19 KB) 1.54 MB
/settings/appearance 8.36 KB (🟢 -167 B) 1.53 MB
/settings/cookies 7.59 KB (🟢 -177 B) 1.53 MB
/settings/data 7.49 KB (🟢 -176 B) 1.53 MB
/settings/environment-variables 8.8 KB (🟢 -165 B) 1.53 MB
/settings/modules 13.23 KB (🔴 +3.39 KB) 1.53 MB
/settings/notifications 11.15 KB (🟢 -120 B) 1.53 MB
/settings/safe-apps 12.11 KB (🟢 -162 B) 1.53 MB
/settings/security-login 39.8 KB (🔴 +25.43 KB) 1.56 MB
/settings/setup 24.06 KB (🟢 -75 B) 1.54 MB
/terms 10.06 KB (🟢 -17 B) 1.53 MB
/transactions 52.49 KB (🟡 +21 B) 1.57 MB
/transactions/history 52.46 KB (🟡 +21 B) 1.57 MB
/transactions/messages 18.59 KB (🟡 +2 B) 1.54 MB
/transactions/queue 26 KB (🔴 +6.89 KB) 1.55 MB
/transactions/tx 6.26 KB (🟡 +2 B) 1.53 MB
/welcome 7.13 KB (🟢 -1 B) 1.53 MB
/welcome/social-login 7.57 KB (🟡 +1 B) 1.53 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

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

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

github-actions bot commented Nov 28, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
76.13% (+0.05% 🔼)
10741/14109
🔴 Branches
50.57% (-0.02% 🔻)
2190/4331
🔴 Functions
59.08% (-0.03% 🔻)
1620/2742
🟡 Lines
77.57% (+0.05% 🔼)
9730/12543
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🔴
... / dispatch.ts
42.01% (+1.44% 🔼)
55%
23.53% (-2.28% 🔻)
40.63% (+1.47% 🔼)

Test suite run success

1225 tests passing in 172 suites.

Report generated by 🧪jest coverage report action from 6c7fca8

@@ -55,7 +55,7 @@ export function CancelRecoveryButton({
return (
<CheckWallet allowNonOwner>
{(isOk) => {
const isDisabled = !isOk || (isGuardian && !isExpired)
const isDisabled = isOwner ? !isOk : !isOk && !isExpired
Copy link
Member

Choose a reason for hiding this comment

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

This makes it possible to cancel a recovery tx as a non-owner before it has expired. I assume that tx would fail so I suggest to still disable it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've tweaked the logic in 6c7fca8 to only disable if not expired as non-owners are able to skip expired transactions

@iamacook iamacook merged commit e9e0974 into recovery-epic Nov 28, 2023
11 of 13 checks passed
@iamacook iamacook deleted the recovery-cancel-period branch November 28, 2023 16:25
@github-actions github-actions bot locked and limited conversation to collaborators Nov 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants