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
b993afbf
Unverified
Commit
b993afbf
authored
Aug 07, 2023
by
yudai yamamoto
Committed by
GitHub
Aug 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix action failures due to state tree encoding (#53655)
fixes #53654 ### Related PRs - #51017
parent
78b04980
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
server-action-reducer.ts
...mponents/router-reducer/reducers/server-action-reducer.ts
+1
-1
app-action.test.ts
test/e2e/app-dir/actions/app-action.test.ts
+10
-0
No files found.
packages/next/src/client/components/router-reducer/reducers/server-action-reducer.ts
View file @
b993afbf
...
@@ -52,7 +52,7 @@ async function fetchServerAction(
...
@@ -52,7 +52,7 @@ async function fetchServerAction(
headers
:
{
headers
:
{
Accept
:
RSC_CONTENT_TYPE_HEADER
,
Accept
:
RSC_CONTENT_TYPE_HEADER
,
'Next-Action'
:
actionId
,
'Next-Action'
:
actionId
,
[
NEXT_ROUTER_STATE_TREE
]:
JSON
.
stringify
(
state
.
tree
),
[
NEXT_ROUTER_STATE_TREE
]:
encodeURIComponent
(
JSON
.
stringify
(
state
.
tree
)
),
...(
process
.
env
.
__NEXT_ACTIONS_DEPLOYMENT_ID
&&
...(
process
.
env
.
__NEXT_ACTIONS_DEPLOYMENT_ID
&&
process
.
env
.
NEXT_DEPLOYMENT_ID
process
.
env
.
NEXT_DEPLOYMENT_ID
?
{
?
{
...
...
test/e2e/app-dir/actions/app-action.test.ts
View file @
b993afbf
...
@@ -393,6 +393,16 @@ createNextDescribe(
...
@@ -393,6 +393,16 @@ createNextDescribe(
return
newTestCookie
!==
currentTestCookie
?
'success'
:
'failure'
return
newTestCookie
!==
currentTestCookie
?
'success'
:
'failure'
},
'success'
)
},
'success'
)
})
})
it
(
'should handle unicode search params'
,
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/server?name=名'
)
const
cnt
=
await
browser
.
elementByCss
(
'h1'
).
text
()
expect
(
cnt
).
toBe
(
'0'
)
await
browser
.
elementByCss
(
'#inc'
).
click
()
await
check
(()
=>
browser
.
elementByCss
(
'h1'
).
text
(),
'1'
)
})
})
})
describe
(
'fetch actions'
,
()
=>
{
describe
(
'fetch actions'
,
()
=>
{
...
...
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