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
b8988d70
Commit
b8988d70
authored
Feb 04, 2026
by
Tim Neutkens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cache.ts
parent
c93eaa58
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
cache.ts
packages/next/src/client/components/segment-cache/cache.ts
+3
-1
No files found.
packages/next/src/client/components/segment-cache/cache.ts
View file @
b8988d70
...
@@ -2534,10 +2534,11 @@ function createPrefetchResponseStream(
...
@@ -2534,10 +2534,11 @@ function createPrefetchResponseStream(
// While processing the original stream, we also incrementally update the size
// While processing the original stream, we also incrementally update the size
// of the cache entry in the LRU.
// of the cache entry in the LRU.
let
totalByteLength
=
0
let
totalByteLength
=
0
let
closed
=
false
const
reader
=
originalFlightStream
.
getReader
()
const
reader
=
originalFlightStream
.
getReader
()
return
new
ReadableStream
({
return
new
ReadableStream
({
async
pull
(
controller
)
{
async
pull
(
controller
)
{
while
(
true
)
{
while
(
!
closed
)
{
const
{
done
,
value
}
=
await
reader
.
read
()
const
{
done
,
value
}
=
await
reader
.
read
()
if
(
!
done
)
{
if
(
!
done
)
{
// Pass to the target stream and keep consuming the Flight response
// Pass to the target stream and keep consuming the Flight response
...
@@ -2554,6 +2555,7 @@ function createPrefetchResponseStream(
...
@@ -2554,6 +2555,7 @@ function createPrefetchResponseStream(
}
}
// The server stream has closed. Exit, but intentionally do not close
// The server stream has closed. Exit, but intentionally do not close
// the target stream. We do notify the caller, though.
// the target stream. We do notify the caller, though.
closed
=
true
reader
.
releaseLock
()
reader
.
releaseLock
()
onStreamClose
()
onStreamClose
()
return
return
...
...
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