Repository navigation
fix(sdk): avoid final confirmation sleep - #45
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates sendAndWaitForCommit in packages/sdk/src/sdk.ts to break early from the confirmation loop when the maximum number of confirmation checks is reached, preventing an unnecessary sleep. The corresponding test in packages/sdk/src/sdk.test.ts has been updated to mock and assert that sleep is not called in this scenario. The reviewer suggested combining the consecutive if statements into a single conditional check to simplify control flow and improve readability.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the sendAndWaitForCommit function in packages/sdk/src/sdk.ts to break out of the polling loop early when the maximum number of confirmation checks is reached. It also updates the corresponding unit test in packages/sdk/src/sdk.test.ts to mock the sleep function and assert that it is not called during a timeout scenario. There are no review comments to address, and I have no additional feedback to provide.
|
LGTM Phroi %5 |
Why
sendAndWaitForCommitcould sleep after the final allowed confirmation check even though it was about to time out. With smallmaxConfirmationChecks, that added a full unnecessary interval after the last poll.Changes