Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/floppy-clocks-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Prevents incorrect failures in widget onramps.
5 changes: 5 additions & 0 deletions packages/thirdweb/src/react/core/hooks/useStepExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,11 @@

const status = statusResult.status;
if (status === "COMPLETED") {
/*
* The occasional race condition can happen where the onramp provider gives us completed status before the token balance has updated in our RPC.
* We add this pause so the simulation doesn't fail on the next step.
*/
await new Promise((resolve) => setTimeout(resolve, 2000));

Check warning on line 379 in packages/thirdweb/src/react/core/hooks/useStepExecutor.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/react/core/hooks/useStepExecutor.ts#L379

Added line #L379 was not covered by tests
setOnrampStatus("completed");
// Add type field for discriminated union
const typedStatusResult = {
Expand Down
Loading