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

[EPIC] Recovery #2801

Merged
merged 88 commits into from
Dec 1, 2023
Merged

[EPIC] Recovery #2801

merged 88 commits into from
Dec 1, 2023

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Nov 13, 2023

This implements a recovery feature, which when enabled deploys a Delay Modifier.

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) 🧑‍💻

* feat: poll recovery state of Safe

* fix: remove builders

* fix: add `timestamp` and validity to state

* fix: types

* fix: add flag check

* fix: add test coverage

* fix: incorrect spy

* fix: skipped test

* fix: `tx-builder.spec` test

* fix: move parsing logic to service

* refactor: only query from Safe creation block
Copy link

github-actions bot commented Nov 13, 2023

Branch preview

✅ Deploy successful!

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

Copy link

github-actions bot commented Nov 13, 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 13, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
76.25% (+0.26% 🔼)
10889/14281
🔴 Branches
50.71% (+0.68% 🔼)
2219/4376
🔴 Functions
59.78% (+0.96% 🔼)
1654/2767
🟡 Lines
77.63% (+0.12% 🔼)
9860/12702
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / transaction.ts
91.07% 93.33% 92.31% 89.58%
🟡
... / safeTx.ts
66.67% 100% 50% 60%
🟢
... / recovery-state.ts
95.16% 85% 85.71% 96.43%
🟢
... / safe.ts
100% 100% 100% 100%
🔴
... / useIsRecoverer.ts
57.14% 0% 0% 57.14%
🟢
... / selectors.ts
100% 100% 100% 100%
🟢
... / index.tsx
100% 100% 100% 100%
🟢
... / useRecoveryState.ts
97.73% 77.78% 100% 97.67%
🟢
... / recoveryEvents.ts
100% 100% 100% 100%
🟢
... / useRecoveryDelayModifiers.ts
100% 100% 100% 100%
🟡
... / delay-modifier.ts
65.85% 25% 50% 64.1%
🟡
... / proxies.ts
71.43% 100% 75% 71.43%
🟢
... / useRecoveryPendingTxs.ts
95% 75% 100% 94.74%
🟢
... / useRecoverySuccessEvents.ts
94.12% 87.5% 100% 93.33%
🟢
... / useIsValidRecoveryExecution.ts
100% 100% 100% 100%
🟢
... / useRecoveryTxState.ts
100% 100% 100% 100%
🟢
... / useClock.ts
100% 0% 100% 100%
🟢
... / setup.ts
91.38% 80% 91.67% 90.57%
🟢
... / index.tsx
92.06% 100% 86.67% 93.55%
🟢
... / useRecoveryQueue.ts
100% 75% 100% 100%
🟢
... / RecoveryInProgressCard.tsx
100% 100% 100% 100%
🟢
... / recovery.ts
66.67% 100% 100% 100%
🟢
... / index.tsx
94.12% 60% 100% 94.12%
🟢
... / RecoveryProposalCard.tsx
93.33% 75% 80% 92.59%
🟡
... / index.tsx
72.73% 50% 33.33% 72.73%
🔴
... / RecoverAccountFlowReview.tsx
47.62% 0% 0% 47.62%
🔴
... / recovery-sender.ts
13.21% 0% 0% 13.21%
🟡
... / index.tsx
66.67% 0% 0% 66.67%
🔴
... / RecoverAccountFlowSetup.tsx
51.28% 16.67% 30% 51.35%
🟢
... / constants.ts
50% 100% 100% 100%
🟡
... / useIsSidebarRoute.ts
66.67% 100% 0% 66.67%
🔴
... / useTxHistory.ts
50% 0% 0% 50%
🟢
... / transaction-list.ts
96.97% 86.67% 100% 96.77%
🟢
... / index.tsx
94.59% 100% 88.89% 100%
🟡
... / PendingTxsList.tsx
63.04% 33.33% 30% 65.91%
🟡
... / PendingTxListItem.tsx
65.38% 0% 0% 68%
🟡
... / PendingRecoveryListItem.tsx
64.29% 100% 0% 64.29%
🟡
... / index.tsx
50% 0% 0% 60%
🟡
... / index.tsx
66.67% 0% 0% 72.73%
🟡
... / index.tsx
60% 0% 0% 60%
🟡
... / index.tsx
60% 0% 0% 60%
🟡
... / RemoveRecoveryFlowOverview.tsx
66.67% 100% 0% 66.67%
🔴
... / RemoveRecoveryFlowReview.tsx
56.25% 100% 0% 56.25%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / transaction-calldata.ts
98.33% (-1.67% 🔻)
100% 100% 100%
🔴 src/utils/date.ts
55% (-1.52% 🔻)
0%
62.5% (-4.17% 🔻)
51.72% (+1.72% 🔼)
🟡
... / index.tsx
69.05%
12.5% (-1.14% 🔻)
33.33% 67.5%
🔴
... / useTxStepper.tsx
21.05% (-0.38% 🔻)
0% (-100% 🔻)
0%
22.22% (-5.05% 🔻)
🟢
... / index.tsx
86.49% (+0.77% 🔼)
50% (-2.63% 🔻)
44.44%
88.57% (+0.69% 🔼)
🟢
... / index.tsx
96.3% (-3.7% 🔻)
62.5% (-37.5% 🔻)
83.33% (-16.67% 🔻)
96.15% (-3.85% 🔻)

Test suite run success

1269 tests passing in 175 suites.

Report generated by 🧪jest coverage report action from 9d9e0e4

* fix: fix and optimise fetching the recovery state

* fix: review issues

* fix: use existing utils function
Copy link

github-actions bot commented Nov 14, 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 (🟡 +130.12 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-five 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 (🟢 -95 B) 1.53 MB
/apps 34.59 KB (🟢 -5 B) 1.56 MB
/apps/custom 27.12 KB (🟢 -5 B) 1.55 MB
/apps/open 26.79 KB (🟡 +35 B) 1.55 MB
/balances/nfts 18.68 KB (-1 B) 1.54 MB
/home 53.69 KB (🔴 +30.08 KB) 1.58 MB
/new-safe/create 11.83 KB (🟢 -2 B) 1.53 MB
/new-safe/load 7.3 KB (🟡 +12 B) 1.53 MB
/settings/appearance 8.02 KB (🟢 -516 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 12.56 KB (🔴 +2.66 KB) 1.54 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 44.19 KB (🔴 +29.82 KB) 1.57 MB
/settings/setup 24.06 KB (🟢 -246 B) 1.55 MB
/share/safe-app 9.27 KB (🟢 -174 B) 1.53 MB
/transactions 52.5 KB (🟡 +32 B) 1.57 MB
/transactions/history 52.47 KB (🟡 +32 B) 1.57 MB
/transactions/messages 18.6 KB (🟡 +13 B) 1.54 MB
/transactions/queue 26.62 KB (🔴 +7.47 KB) 1.55 MB
/transactions/tx 6.27 KB (🟡 +13 B) 1.53 MB
/welcome 7.14 KB (🟡 +6 B) 1.53 MB
/welcome/social-login 7.57 KB (🟡 +4 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.

* feat: recovery dashboard widget

* fix: remove relaying widget

* fix: `tx-builder.spec` test

* fix: badge colour

* fix: test
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

* feat: enable recovery flow structure

* feat: intro step

* feat: basic settings template

* feat: settings + review step

* fix: add test coverage + remove comments

* fix: cleanup code + rename test

* fix: test

* fix: spacing + add connector

* refactor: extract `Chip` component

* fix: rerender + spacing
* feat: poll recovery state of Safe

* fix: remove builders

* fix: add `timestamp` and validity to state

* fix: types

* feat: pending recovery widget

* fix: `gap`

* fix: add flag check

* fix: don't use `Date.now`

* fix: use fake timers

* fix: test

* fix: tests, logo + add `Skeleton`

* fix: test

* fix: reduce interval + remove `Skeleton`
* feat: enable recovery flow structure

* feat: intro step

* feat: basic settings template

* feat: settings + review step

* fix: add test coverage + remove comments

* feat: recovery proposal flow

* fix: only reference owners cache

* fix: owner management transaction

* fix: move error

* fix: encode `multiSend` `data`

* fix: cleanup code + rename test

* fix: test

* fix: spacing + add connector

* refactor: extract `Chip` component

* fix: spacing

* fix: lint + types

* fix: countdown

* refactor: code clarity
* feat: recovery queue

* fix: rename hook + tweak transaction type/tooltip
* feat: recovery info modals + widgets

* fix: remove unnecessary component + comment

* fix: cache modal dismissals

* fix: lint
* fix: add overview of cancellation + skip -> cancel

* fix: icon colour
* feat: recovery email settings structure

* fix: build
* feat: pending recoveries in dashboard widget

* fix: build
* refactor: recovery loading + trigger

* refactor: remove slice + move state to context

* fix: rename context + create helper hook
Copy link

github-actions bot commented Nov 23, 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

* feat: edit recovery flow

* fix: edit initial recovery module

* fix: add guardian validation + test periods

* feat: add recovery delay tooltip

* Merge branch 'recovery-epic' into edit-recovery-flow

* fix: set flow, improve comment + remove caching

* fix: tests
Copy link

github-actions bot commented Nov 30, 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

iamacook and others added 7 commits November 30, 2023 14:38
* fix: fallback MultiSend version for maliciousness

* fix: enhance tests

* fix: increase robustness of test
* fix: upsertion submission disabled on wrong chain

* refactor: promise
* fix: adjust recovery-related wording

* fix: remove unused component + events

* refactor: rename variables to match UI

* fix: typo

* fix: add tracking to links
* feat: Add recovery method modal

* fix: Add missing links

* fix: Add missing logos

* fix: Add missing events, remove feedback info from settings page

* fix: lint and revert changes to tx tracking

* fix: Add event for in progress card button click

* fix: Add list content

* fix: address review comments

* fix: Adjust modal size, add new content
* fix: Adjust in progress card for mobile view

* fix: Adjust cancel recovery mobile view

* fix: Adjust proposal card mobile view

* fix: Adjust in progress card on dashboard for mobile

* fix: Pending tx on dashboard mobile
* feat: recovery dispatch notifications

* feat: add link to notifications

* feat: add `RecoveryEvent.SUCCESS` + notification

* fix: address comments + remove `SUCCESS` event
Copy link

github-actions bot commented Nov 30, 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

iamacook and others added 8 commits December 1, 2023 10:31
* feat: add recovery transaction validation

* Merge branch 'recovery-epic' into recovery-validation

* fix: merge conflicts

* fix: hook

* fix: validate proposed setup with contract

* Revert "fix: validate proposed setup with contract"

This reverts commit 72bcd71.

* fix: remove IIFEs from tests

* fix: adjust clause + add comment
@usame-algan usame-algan marked this pull request as ready for review December 1, 2023 13:06
@iamacook iamacook merged commit edd7745 into dev Dec 1, 2023
15 checks passed
@iamacook iamacook deleted the recovery-epic branch December 1, 2023 13:19
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 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.

4 participants