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
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ allprojects {
}

group = "org.onflow.flow"
val defaultVersion = "0.0.23"
val defaultVersion = "0.0.24"
version = System.getenv("GITHUB_REF")?.split('/')?.last() ?: defaultVersion
}

Expand Down
23 changes: 10 additions & 13 deletions flow/src/commonMain/kotlin/org/onflow/flow/apis/TransactionsApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,17 @@ internal class TransactionsApi(val baseUrl: String) : ApiBase() {
// since finalized transactions haven't been executed yet
return result
}

TransactionStatus.EXECUTED -> {
// Transaction is executed, return result
return result
}
TransactionStatus.SEALED -> {
// Transaction is sealed, return result
return result
}
TransactionStatus.EXPIRED -> throw RuntimeException("Transaction expired")
TransactionStatus.EMPTY, TransactionStatus.UNKNOWN -> {
// Treat empty/unknown status as pending
TransactionStatus.EMPTY, TransactionStatus.UNKNOWN, TransactionStatus.PENDING -> {
// Treat empty/unknown/pending status as still processing, continue polling
attempts++
// Use exponential backoff with jitter for first few attempts, then stabilize
val delayMs = when {
Expand All @@ -118,16 +125,6 @@ internal class TransactionsApi(val baseUrl: String) : ApiBase() {
}
delay(delayMs)
}

else -> {
attempts++
val delayMs = when {
attempts <= 5 -> 1000L
attempts <= 15 -> 2000L
else -> 3000L
}
delay(delayMs)
}
}
} catch (e: Exception) {
lastError = e
Expand Down
Loading