Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
94313366
Unverified
Commit
94313366
authored
Jan 17, 2025
by
Jiachi Liu
Committed by
GitHub
Jan 17, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix fetch lock not being consistently released (#75028)
parent
25e84437
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
190 additions
and
115 deletions
+190
-115
patch-fetch.ts
packages/next/src/server/lib/patch-fetch.ts
+122
-115
app-fetch-deduping-errors.test.ts
...p-fetch-deduping-errors/app-fetch-deduping-errors.test.ts
+13
-0
page.tsx
test/e2e/app-dir/app-fetch-deduping-errors/app/[id]/page.tsx
+45
-0
layout.tsx
test/e2e/app-dir/app-fetch-deduping-errors/app/layout.tsx
+10
-0
No files found.
packages/next/src/server/lib/patch-fetch.ts
View file @
94313366
This diff is collapsed.
Click to expand it.
test/e2e/app-dir/app-fetch-deduping-errors/app-fetch-deduping-errors.test.ts
0 → 100644
View file @
94313366
import
{
nextTestSetup
}
from
'e2e-utils'
describe
(
'app-fetch-errors'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
})
it
(
'should still successfully render when a fetch request that acquires a cache lock errors'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/1'
)
expect
(
await
browser
.
elementByCss
(
'body'
).
text
()).
toBe
(
'Hello World 1'
)
})
})
test/e2e/app-dir/app-fetch-deduping-errors/app/[id]/page.tsx
0 → 100644
View file @
94313366
'use server'
import
{
Metadata
}
from
'next'
export
async
function
generateMetadata
({
params
,
}:
{
params
:
Promise
<
{
id
:
string
}
>
}):
Promise
<
Metadata
>
{
const
{
id
}
=
await
params
try
{
// this fetch request will error
await
fetch
(
'http://localhost:8000'
,
{
cache
:
'force-cache'
,
next
:
{
tags
:
[
'id'
]
},
})
}
catch
(
err
)
{
console
.
log
(
err
)
}
return
{
title
:
id
,
}
}
export
default
async
function
Error
({
params
,
}:
{
params
:
Promise
<
{
id
:
string
}
>
})
{
const
{
id
}
=
await
params
try
{
// this fetch request will error
await
fetch
(
'http://localhost:8000'
,
{
cache
:
'force-cache'
,
next
:
{
tags
:
[
'id'
]
},
})
}
catch
(
err
)
{
console
.
log
(
err
)
}
return
<
div
>
Hello World
{
id
}
</
div
>
}
test/e2e/app-dir/app-fetch-deduping-errors/app/layout.tsx
0 → 100644
View file @
94313366
export
default
function
Layout
({
children
})
{
return
(
<
html
lang=
"en"
>
<
head
>
<
title
>
my static site
</
title
>
</
head
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment