Conversation
…thdrawal operations
ogazboiz
left a comment
There was a problem hiding this comment.
Hey, nice work on the transaction tracking flow. A few things need to be addressed before this can go in:
Must fix:
-
Remove
status.txt- This is agit statusterminal dump that got committed by accident. It's not a real project file. -
Stale closure bug in setTimeout - In both
repay/[loanId]/page.tsxandStepFinalSignature.tsx, the 60-secondsetTimeoutcapturestrackerStateat the time it's scheduled, not when it fires. So the checktrackerState === "confirming"is always looking at a stale value. Use a ref to track current state instead. -
Fake recovery handler -
handleRecoveryjust fakes a success after 2 seconds. Users clicking "Transaction stuck? Try recovery" will get a "Recovery successful" message that does nothing. Either wire it up to real logic, remove the button, or clearly disable it as a placeholder. -
enableEnhancedPollingdefaults totrue- This means every existing mutation usinguseContractMutationwill now start polling Horizon automatically. This is a breaking behavior change for existing callers. Default should befalseso callers opt in. -
Countdown timer never updates -
getEstimatedWaitTime()computes based onDate.now()but nothing triggers re-renders, so the "Xs remaining" text is frozen. You need auseEffectwith asetIntervalto make it tick, or just remove it.
Nice to have:
- The recovery/countdown/timeout logic is nearly identical in both
repay/[loanId]/page.tsxandStepFinalSignature.tsx. Would be cleaner as a shared hook. - The commit message "Implement feature X to enhance user experience and optimize performance" looks like a placeholder, might want to squash that.
|
Friendly reminder to rebase your branch onto the latest main and address the review feedback when you get a chance. The codebase had some fixes recently so a rebase is needed before we can move forward. Let me know if you need help. |
|
heads up, a few important changes just landed on main that affect your PR:
please rebase on latest main: git fetch upstream
git rebase upstream/main
git push --force-with-lease |
I have successfully pushed your latest changes to the transaction-cycle branch on GitHub.
Changes Committed
The following files were committed:
backend/package-lock.json
: Updated dependencies.
backend/src/
tests
/eventIndexer.test.ts
: Fixes and improvements to event indexing tests.
frontend/src/app/[locale]/repay/[loanId]/page.tsx
: UI enhancements for the loan repayment page.
frontend/src/app/hooks/useContractMutation.ts
: Refactored and improved contract mutation hook.
closes #566