revalidatePath not revalidating at all at certain times
Unanswered
Vespid wasp posted this in #help-forum
Vespid waspOP
- When i upload files, a server action is triggered which should revalidatePath and it works correctly everytime
- When i delete a file, another server action is triggerer which shuold revalidatePath, but this time it does not work as expected : It does not revalidate if i hit the function just once, but if i try to delete another file it will revalidate the last one, but will be late everytime -1. Like if i delete a 3rd file it will revalidate the 2nd. I don't know how to explain it.
I'll record a Loom video
- When i delete a file, another server action is triggerer which shuold revalidatePath, but this time it does not work as expected : It does not revalidate if i hit the function just once, but if i try to delete another file it will revalidate the last one, but will be late everytime -1. Like if i delete a 3rd file it will revalidate the 2nd. I don't know how to explain it.
I'll record a Loom video
28 Replies
can we see the code?
Vespid waspOP
the upload fn
the delete fn
the page
where do you call "deleteFileById" ?
Vespid waspOP
i call deleteFileById here
interesting
Vespid waspOP
but the upload is next to it and is working fine
i cant find anything wrong by skimming, might need further debugging
Vespid waspOP
what's intresting is that of the server if i console.log to try to get new vectors i still get the PREVIOUS one after the deletion
I literraly have no idea why and what's wrong
and why it works when i refresh, or when i delete another file
have you tried reproducing it in a minimal reproduction repository
@ᴉuɐpɹɐɐ have you tried reproducing it in a minimal reproduction repository
Vespid waspOP
I didn't, it's quite difficult to reproduce
I'm trying to know if it's me or next.js but even that is hard
I tried
dynamic="force-revalidate" exact same thing, no diffI rewrote everything with revalidateTag + unstable_cache
same thing, even worse, i'm not even able to revalidate it with a hard refresh
what is inside getVectorStores?
Vespid waspOP
What I also don't understand, is that when i upload a file, everything works perfectly it's revalidated but in the network devtools there is 0 request about revalidation i don't know how it's being able to revalidate 😅
this is the getvectorStore
i honestly have no idea why it doesnt work
i would duplicate the project
and remove stuff one by one until it works again
@ᴉuɐpɹɐɐ i would duplicate the project
Vespid waspOP
great idea, i didn't thougt about that at all
thank you so much anyway!