fix: drop retry for read-only simulations to prevent slow UX on 404s - #441
Open
martinshub-tech wants to merge 1 commit into
Open
fix: drop retry for read-only simulations to prevent slow UX on 404s#441martinshub-tech wants to merge 1 commit into
martinshub-tech wants to merge 1 commit into
Conversation
|
@martinshub-tech Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #353
Problem: Previously, simulateReadOnly wrapped both getAccount and simulateTransaction in a withRetry block with up to 3 attempts and exponential backoff. Because a read-only simulation has no side effects, encountering a missing source account (getAccount returning a 404) or a slow RPC shouldn't trigger automatic retries. However, it still caused 3 sequential attempts with a backoff ranging from 500ms to 5s. This resulted in several seconds of unnecessary spinner on the UI for what is essentially a permanent failure.
Solution: Dropped the withRetry wrapper entirely for the read path in simulateReadOnly. Read-only operations don't require protection against partial state commits, and failing fast on 404s gives a significantly faster and more responsive UX. Transient transport failures will now bubble up immediately so the UI can handle or report them without stalling.