-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fixing Transitions #91
Conversation
…transition to finish and then invoke the onSuccess callbacks
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Good catch, appreciate the help with all this transition stuff. Wish Concur with the testing -- @WesternConcrete got client side tests going on #75 but it seems like, as you said, testing The one thing I am thinking about is how this affects the retry option. I originally kept both const { isPending, execute, data, error, isError } = useServerAction(
incrementNumberAction,
{
retry: {
maxAttempts: 3,
delay: 1000,
},
}
) Happy to merge this once the retry functionality is stable. The changes look good and solve the |
@IdoPesok double check when you get a chance, I tested on my own app with retries and without, it seems to continue to show the loader until after all the retries finish |
Added test cases for retrying in #92 , closing this PR as these commits are in there. |
There was still a little bug related to transitions. Basically the useServerAction would invoke onSuccess before the server action was done running revalidatePath or redirect. This refactoring includes
if I get time, I want to add some type of testing to verify this bug won't happen again. The logic for this useServerAction is a bit complex, and I'm worried it's going to start becoming bug food as things are refactored or changed. Unforatnely I think this type of testing would require playwright or cypress because the testing would require verifying the hooks work with the underlying revalidatePath and redirect methods in combination to delays in RSCs refetching data.