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

feat: recovery queue #2832

Merged
merged 2 commits into from
Nov 21, 2023
Merged

feat: recovery queue #2832

merged 2 commits into from
Nov 21, 2023

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Nov 21, 2023

What it solves

Resolves #2763

How this PR fixes it

This implements a new "Pending recovery" section to the transaction queue which displays all recovery attempts from connected recovery-specific Delay Modifiers, as well as associated adjustments:

  • Recovery queue with decoded overview
  • Global state adjustments (executor and isMalicious flags have been added, as well as all timestamps converted to ms)
  • Associated unit tests

Note: text was tweaked and does not necessarily match the design. It is also not possible to skip recovery proposals yet. As such, queued recovery attempts and their "skip" transactions are not included in this PR.

How to test it

  1. Propose a recovery attempt
  2. Observe recovery proposal in queue, displaying cooldown, expiration and option to execute

Screenshots

image

Old naming/colouring:
image

image

image

image

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 linked an issue Nov 21, 2023 that may be closed by this pull request
7 tasks
Copy link

github-actions bot commented Nov 21, 2023

Branch preview

⏳ Deploying a preview site...

Copy link

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

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
75.51% (+0.15% 🔼)
10472/13868
🔴 Branches
50.4% (+0.19% 🔼)
2146/4258
🔴 Functions
58.48% (+0.46% 🔼)
1575/2693
🟡 Lines
77.06% (+0.12% 🔼)
9475/12296
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / safe.ts
100% 100% 100% 100%
🟢
... / transaction-list.ts
96.97% 86.67% 100% 96.77%
🟢
... / useTimestamp.ts
100% 0% 100% 100%
🟢
... / index.tsx
93.75% 50% 100% 93.75%
🟢
... / useRecoveryTxState.ts
92.86% 77.78% 50% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / abTesting.ts
75% (-25% 🔻)
100%
66.67% (-33.33% 🔻)
83.33% (-16.67% 🔻)
🔴
... / dispatch.ts
46.5% (-1.85% 🔻)
61.11%
29.63% (-1.14% 🔻)
45.27% (-1.91% 🔻)
🟡 src/utils/date.ts
65.71% (-3.04% 🔻)
0%
62.5% (-8.93% 🔻)
72.73% (+1.3% 🔼)
🟢
... / recovery-state.ts
98.25% (-1.75% 🔻)
83.33% (-16.67% 🔻)
100%
98.11% (-1.89% 🔻)
🟢
... / index.tsx
84.62% (-2.56% 🔻)
92.31% (+6.59% 🔼)
50% (-20% 🔻)
100% (+3.03% 🔼)
🟢
... / useAbTesting.ts
93.75% (-6.25% 🔻)
75% (-25% 🔻)
100%
92.86% (-7.14% 🔻)

Test suite run success

1193 tests passing in 168 suites.

Report generated by 🧪jest coverage report action from 8da39d0

@@ -0,0 +1,17 @@
import { useState, useEffect } from 'react'

export function useTimestamp(interval = 1_000): number {
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 call this hook useClock or useIntervalTimestamp. useTimestamp to me reads as a one-time timestamp.

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 renamed it to useClock in 6896ea6.


export const RecoveryInfo = (): ReactElement => {
return (
<Tooltip title="This recovery attempt was not created via the interface" placement="top" arrow>
Copy link
Member

@katspaugh katspaugh Nov 21, 2023

Choose a reason for hiding this comment

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

This recovery attempt was not created via the interface

That it wasn't created via the interface is a poor way to say it's a fraudulent transaction.

Design-wise, I wouldn't even display them as recovery attempts. Too easy to confuse with a legit recovery. The font should be red at least.

Screenshot 2023-11-21 at 11 09 13

Copy link
Member Author

@iamacook iamacook Nov 21, 2023

Choose a reason for hiding this comment

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

I've renamed the transaction type to "Malicious transaction" (coloured in error.main) and changed the tooltip to "Suspicious activity" in 6896ea6.

image

@iamacook iamacook merged commit 98c9ede into recovery-epic Nov 21, 2023
9 of 11 checks passed
@iamacook iamacook deleted the recover-tx-list branch November 21, 2023 10:40
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Recovery] Transaction queue - group skipped transactions
2 participants