-
Notifications
You must be signed in to change notification settings - Fork 457
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: recovery loading + trigger #2850
Conversation
Branch preview✅ Deploy successful! https://refactor_recovery_loading--walletweb.review-wallet-web.5afe.dev |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Coverage report❌ An unexpected error occurred. For more details, check console
Show new covered files 🐣
Show files with reduced coverage 🔻
Test suite run failedFailed tests: 5/1219. Failed suites: 2/174.
Report generated by 🧪jest coverage report action from fbccae4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Only two suggestions:
- Rename the context to just RecoveryContext
- Add a helper hook to wrap
useContext(RecoveryLoaderContext).state
I've included both adjustments in fbccae4. |
What it solves
Refetching recovery logic after interaction with the module.
How this PR fixes it
The data loading has been refactored into a provider that exposes a
refetch
function that is passed to the relevant transaction dispatchers for direct module interaction and called after transaction success.For Safe transactions, the
to
address is dispatched alongside theTxEvent.PROCESSED
event and, providing it matches a recovery module, it refetches the recovery data.Note: this does not work for relayed transactions as we do not readily have the
to
address available in the logic flow, which may require a larger refactor. This has been marked with a comment for now to revisit.How to test it
Observe data refetching when editing a recovery module, as well as skipping a recovery attempt.
Checklist