Skip to content

Commit

Permalink
go back to ignoring revalidates from render (#71088)
Browse files Browse the repository at this point in the history
Reverts most of #70446. We're going to ban calling
revalidateTag/revalidatePath during render in #71030, so this is no
longer needed

(also, this usage of `ctx.renderOpts.waitUntil` was never correct
anyway)
  • Loading branch information
lubieowoce authored and eps1lon committed Oct 11, 2024
1 parent a4fdf29 commit 35ad37e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 59 deletions.
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)
})
})
})

0 comments on commit 35ad37e

Please sign in to comment.