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

go back to ignoring revalidates from render #71088

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions packages/next/src/server/app-render/app-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,22 +517,6 @@ async function generateDynamicFlightRenderResult(
onError,
}
)
await waitAtLeastOneReactRenderTask()

if (
ctx.workStore.pendingRevalidates ||
ctx.workStore.revalidatedTags ||
ctx.workStore.pendingRevalidateWrites
) {
const promises = Promise.all([
ctx.workStore.incrementalCache?.revalidateTag(
ctx.workStore.revalidatedTags || []
),
...Object.values(ctx.workStore.pendingRevalidates || {}),
...(ctx.workStore.pendingRevalidateWrites || []),
])
ctx.renderOpts.waitUntil = (p) => promises.then(() => p)
}

return new FlightRenderResult(flightReadableStream, {
fetchMetrics: ctx.workStore.fetchMetrics,
Expand Down

This file was deleted.

19 changes: 0 additions & 19 deletions test/e2e/app-dir/revalidatetag-rsc/revalidatetag-rsc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,4 @@ describe('revalidateTag-rsc', () => {
expect(randomNumber3).not.toEqual(randomNumber)
})
})

it('should revalidate fetch cache if revalidateTag invoked via server component', async () => {
const browser = await next.browser('/')
const randomNumber = await browser.elementById('data').text()
await browser.refresh()
const randomNumber2 = await browser.elementById('data').text()
expect(randomNumber).toEqual(randomNumber2)
await browser.elementByCss('#revalidate-via-page').click()
await browser.waitForElementByCss('#home')
await browser.elementByCss('#home').click()
await browser.waitForElementByCss('#data')
await retry(async () => {
// need to refresh to evict client router cache
await browser.refresh()
await browser.waitForElementByCss('#data')
const randomNumber3 = await browser.elementById('data').text()
expect(randomNumber3).not.toEqual(randomNumber)
})
})
})
Loading