-
Notifications
You must be signed in to change notification settings - Fork 110
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: setting the right tag values for fetch cache #304
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@khuezy I can confirm that this fixes the fetch cache issue in my app with latest nextjs and open-next version after testing it. So I think it can me merged. It also corresponds with what the new docs say are the parameters according to the latest PR https://github.com/vercel/next.js/blob/63ffdea4ab66a69d67d24161c995fd45e7b276f2/docs/02-app/01-building-your-application/08-deploying/index.mdx so we can hope that this will stay stable for a bit |
@@ -298,7 +310,7 @@ export default class S3Cache { | |||
// If we use an in house version of getDerivedTags in build we should use it here instead of next's one | |||
const derivedTags: string[] = | |||
data?.kind === "FETCH" | |||
? data.data.tags ?? [] | |||
? ctx?.tags ?? [] |
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.
Will this break backwards compatibility? Can we do ctx?.tags ??data?.data?.tags ?? []
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.
Yeah you're right, that's how it should be done
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.
I just updated my PR with this change
Thanks! The changes LGTM |
Right now the tag property is always empty, I tried to check in the nextjs code base the reason and i found this relevant code
this code was introduced in this PR, So I'm wondering how we should manage that for older versions of nextjs that don't have that change.
Also ideally I would like to add some tests to the open-next repo to make sure that revalidateTag works ok but I still don't understand fully the setup and how to write that test so this PR is probably a WIP