Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Finalize button stuck in pending upon motion finalization #4260

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

mmioana
Copy link
Contributor

@mmioana mmioana commented Feb 7, 2025

Description

Screen.Recording.2025-02-07.at.09.32.57.mov
  • However, I found an issue where, if two users are quick enough to finalize a motion, only one will succeed. The less fortunate user will be left with a pending button that persists until the page is refreshed. This happens because the form remains in a submitting state even after the motion is finalized. This PR aims to address the issue.

Note

While the transaction will still fail for the unlucky user, they will now be able to continue with stake claiming if applicable
Screenshot 2025-02-07 at 09 27 33

Testing

Note

It will be useful to have 2 browser windows opened, in one logged in as leela and the other as amy or fry

  • Step 1. Please install the Reputation Weighted extension and enable it
  • Step 2. Create a Mint tokens motion as leela using Reputation
  • Step 3. Fully stake it and oppose to it
  • Step 4. Switch to amy and vote for the motion. Now vote also as leela
  • Step 5. Proceed to the Finalize step. Check both leela and amy see the Finalize button
  • Step 6. Now you're going to be a bit fast, so Finalize the motion both as leela and amy
  • Step 7. Check the Pending button is not getting stuck for any of the users and they can proceed to Claim.
    One of the users will still have the Pending transaction as finalising the motion will fail and the RetryProvider keeps re-trying it.
  • Step 8. Claim the rewards where applicable and check there are no issues.

On this branch

Screen.Recording.2025-02-07.at.09.26.27.mov

Master

Screen.Recording.2025-02-07.at.09.29.04.mov

Diffs

New stuff

  • FinalizeStepContent to simplify a bit the code for the FinalizeStep

Resolves #4170

Fix: Reset form state upon motion finalization in FinalizeStep
@mmioana mmioana self-assigned this Feb 7, 2025
@mmioana mmioana marked this pull request as ready for review February 7, 2025 08:58
@mmioana mmioana requested a review from a team as a code owner February 7, 2025 08:58
bassgeta
bassgeta previously approved these changes Feb 7, 2025
Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this 😎
I would like to thank my ultrawide monitor for the speed ⏩

finalize-penderino.mp4

Copy link
Contributor

@Nortsova Nortsova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work!

image image

I just did small fix to remove margin bottom for amy at claim block:
image

Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, this is working nicely now!

Screen.Recording.2025-02-07.at.15.03.50.mov

And the padding was fixed after I did another pull:

Screenshot 2025-02-07 at 15 34 45

@mmioana mmioana merged commit 08715e3 into master Feb 7, 2025
2 checks passed
@mmioana mmioana deleted the fix/4170-pending-visible-finalize-button branch February 7, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants