Skip to content

Commit

Permalink
Update fetch cache internal handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ijjk committed Feb 28, 2023
1 parent 6b27604 commit 99d6e24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ jobs:
node: [16]
group: [1, 2, 3, 4, 5, 6, 7, 8]
# run LTS matrix always and maintenance tests during a release
if: ${{ needs.build.outputs.isRelease == 'true' }}
# if: ${{ needs.build.outputs.isRelease == 'true' }}
steps:
- run: echo "${{needs.build.outputs.docsChange}}"

Expand Down Expand Up @@ -822,7 +822,7 @@ jobs:
testDevLTS,
testProdLTS,
testDevE2ELTS,
testprode2elts,
testProdE2ELTS,
]
steps:
- run: exit 0
Expand Down
6 changes: 3 additions & 3 deletions packages/next/src/server/lib/patch-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ export function patchFetch({
serverHooks: typeof import('../../client/components/hooks-server-context')
staticGenerationAsyncStorage: StaticGenerationAsyncStorage
}) {
if ((globalThis.fetch as any).patched) return
if ((fetch as any).__nextPatched) return

const { DynamicServerError } = serverHooks

const originFetch = fetch

// @ts-expect-error - we're patching fetch
Expand Down Expand Up @@ -151,6 +150,7 @@ export function patchFetch({
}

const doOriginalFetch = async () => {
init = init || {}
return originFetch(input, init).then(async (res) => {
if (
staticGenerationStore.incrementalCache &&
Expand Down Expand Up @@ -291,5 +291,5 @@ export function patchFetch({
return doOriginalFetch()
}
)
;(globalThis.fetch as any).patched = true
;(fetch as any).__nextPatched = true
}

0 comments on commit 99d6e24

Please sign in to comment.