-
Notifications
You must be signed in to change notification settings - Fork 15
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: refetch action data after the motion countdown timer is finished #3948
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work fixing this issue @rumzledz 🙌
Installed the Reputation
extension
Created an Advanced Payment
using staking
Selected Reputation
for the funding step
And the motion state updates without getting stuck 🎉
Screen.Recording.2024-12-16.at.10.21.38.mov
@rumzledz I tried to check what is actually happening in the code after reading your expanded description, and noticed that once the timer finishes actually this effect doesn't get triggered
/* Ensures motion state is kept in sync with motion data */
useEffect(() => {
if (action?.motionData) {
refetchMotionState();
}
}, [action?.motionData, refetchMotionState]);
Maybe it's worth investigating in a future issue why this is happening, but for the time being, your solution is good 🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice investigation @rumzledz! It looks like it's still slightly flaky though, for me it's still getting stuck once in a while. Maybe take a look at what @mmioana suggested before, and if not or if it's still being weird then we can pair up on it if you like. Also if this is only happening to me and it's working every time for others then just ignore me :)
Hey @davecreaser what @mmioana has said is practically what I explained on my description 😅 She's basically saying that the useEffect hook isn't running and the reason for that is due to how our queries are not resolving. The useEffect hook she mentioned: useEffect(() => {
if (action?.motionData) {
refetchMotionState();
}
}, [action?.motionData, refetchMotionState]); Runs based on I'll jump on a call with you to see what's going on with your local 👌 |
@davecreaser @mmioana actually on 2nd look at Ioana's comment, the The hook that needs to resolve in this scenario is |
339557f
to
8699e83
Compare
8699e83
to
ae56c9d
Compare
ae56c9d
to
d2f4a9b
Compare
@mmioana @davecreaser I've updated the code and I'm pretty confident about this one 🙌 (famous last words 😂 ) Can you please check again when you get the chance? obrigado & grazie! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really big thumbs up both to you @rumzledz and @davecreaser for this solution 🙌
Created an advanced payment using Staking
Selected Reputation
as the funding method
And it all works flawlessly ✨
Screen.Recording.2024-12-18.at.21.54.55.mov
Nice job!!!
Description
Special shoutouts to @davecreaser for helping me figure out that there was a little bit of delay on Contract side when it comes to the motion state updates 💯
So I ended up changing my solution to using the safe polling timeout as the interval delay for refetching the motion state. And it works like a charm ✨
Testing
Note
There is a bug on
master
whereby if you don't stake the motion and you just allow the motion countdown timer to finish, then the button gets stuck to Pending. We'll fix this in a separate PR.0.005
(this will make your life easier)Resolves #3729