Fix pending order of stakeMotion
transactions
#2760
Merged
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.
Description
In very specific cases there can be a problem with two transactions appearing to be pending when staking a motion (see @arrenv's issue for a full walkthrough).
This is a problem with the order certain transaction functions are called. In this case a transactions further down is set to pending while two others are not completed yet. This PR fixes that. For a fix that resolves this for good see my Transactions API refactor in which this can't happen.
Testing
Follow the steps in @arrenv's issue. At least you should not be seeing two loading spinners.
Diffs
Changes 🏗
stakeMotion
action pending transaction ordertransactionPending
s for good measureResolves #2739 (at least partly)