-
Notifications
You must be signed in to change notification settings - Fork 32
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
fe/updated time remaining pending transaction #1541
Conversation
…action` and `BridgeTransaction` where estimated duration matches up
…ons fired off have accurate time if existing pending
WalkthroughThe changes primarily focus on improving the tracking and calculation of elapsed time and time remaining for pending transactions in the Changes
Poem
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx (1 hunks)
- packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (3 hunks)
Files skipped from review due to trivial changes (1)
- packages/synapse-interface/components/Portfolio/Transaction/MostRecentTransaction.tsx
Additional comments: 3
packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (3)
99-159: The logic for tracking elapsed time and calculating remaining time seems sound. However, it's important to ensure that the
startedTimestamp
is always accurate and updated correctly when a transaction starts. Also, theupdatedElapsedTime
state variable should be updated at regular intervals as long as the transaction is in progress.213-217: Logging the resolved transaction is a good practice for debugging and tracking purposes. However, ensure that this does not expose any sensitive information in a production environment.
248-256: The
Transaction
component is being passed the correct props. Ensure that theTransaction
component handles these props correctly.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1541 +/- ##
=============================================
Coverage 51.23324% 51.23324%
=============================================
Files 362 362
Lines 24691 24691
Branches 283 283
=============================================
Hits 12650 12650
Misses 10813 10813
Partials 1228 1228
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@coderabbitai pause |
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.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (4 hunks)
Additional comments: 2
packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (2)
212-216: Logging the resolved transaction is a good practice for debugging purposes. However, ensure that this does not expose sensitive information in a production environment.
247-255: The props passed to the
Transaction
component are correctly derived from the state and props of thePendingTransaction
component. However, ensure that all these values are validated and sanitized before being passed to theTransaction
component.
packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx
Outdated
Show resolved
Hide resolved
packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx
Outdated
Show resolved
Hide resolved
Deploying with Cloudflare Pages
|
@coderabbitai resume |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (3 hunks)
Additional comments: 3
packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (3)
99-159: The logic for tracking elapsed time and calculating remaining time seems sound. However, it's worth noting that the
setInterval
function can lead to potential issues if the component unmounts before the interval is cleared. This can be mitigated by checking if the component is still mounted before callingsetUpdatedElapsedTime
.196-241: The retry logic in
updateResolvedTransaction
is a good practice for handling network requests. However, it's important to ensure that the maximum number of retries and the delay between retries are set to reasonable values to avoid unnecessary network traffic and potential rate limiting issues.267-275: The conditional assignment of
timeRemaining
based onisSubmitted
is a good practice to ensure that the correct value is passed to the child component. However, it's important to ensure thatisSubmitted
is always correctly set to avoid potential issues.
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (3 hunks)
Additional comments: 2
packages/synapse-interface/components/Portfolio/Transaction/PendingTransaction.tsx (2)
95-160: The logic for calculating the elapsed time and remaining time seems to be correct. However, it's important to ensure that the
startedTimestamp
is always accurate and updated correctly when a transaction is initiated. Also, theisSubmitted
flag should be set to true only when the transaction is actually submitted. This is to ensure that the elapsed time and remaining time are calculated correctly.268-276: The
timeRemaining
prop passed to theTransaction
component is conditionally set based on theisSubmitted
flag. This is a good practice as it ensures that the remaining time is only calculated and displayed when the transaction is actually submitted.
waitForTransaction()
Summary by CodeRabbit
Summary by CodeRabbit
timeRemaining
calculation in thePendingTransaction
component.d70b108ddf1353afea3b97b6f6ed55ea7933a08a: synapse-interface preview link
23ceffe90d581a3b805929bc4b80caba4fe7d826: synapse-interface preview link
ccc0c4c7f2da3fde7c9fbfd03c9b6673049ad48d: synapse-interface preview link
95c511d04bbb7266f1840ad38698f775da25163c: synapse-interface preview link