Skip to content

Commit 52f3da8

Browse files
committed
Bugfix: useFormState queues actions in wrong order (#27570)
I neglected to update the "last" pointer of the action queue. Since the queue is circular, rather than dropping the update, the effect was to add the update to the front of the queue instead of the back. I didn't notice earlier because in my demos/tests, the actions would either resolve really quickly or the actions weren't order dependent (like incrementing a counter). DiffTrain build for commit b8e47d9.
1 parent 56c48f7 commit 52f3da8

File tree

7 files changed

+17
-15
lines changed

7 files changed

+17
-15
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<4aba8405b48af51650328aaea1ae0e6d>>
10+
* @generated SignedSource<<cbd8ea0713685000d0b28083e1b0ef92>>
1111
*/
1212

1313
'use strict';
@@ -8054,7 +8054,7 @@ function dispatchFormState(fiber, actionQueue, setState, payload) {
80548054
payload: payload,
80558055
next: first
80568056
};
8057-
last.next = _newLast;
8057+
actionQueue.pending = last.next = _newLast;
80588058
}
80598059
}
80608060

@@ -24887,7 +24887,7 @@ function createFiberRoot(
2488724887
return root;
2488824888
}
2488924889

24890-
var ReactVersion = "18.3.0-canary-05fbd1aab-20231023";
24890+
var ReactVersion = "18.3.0-canary-b8e47d988-20231023";
2489124891

2489224892
// Might add PROFILE later.
2489324893

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<af98f481db9b1e6f45f4f7d9c8ec7113>>
10+
* @generated SignedSource<<3c60c6d80dc890b93e2083f2bdb9724f>>
1111
*/
1212

1313
"use strict";
@@ -2694,7 +2694,8 @@ function dispatchFormState(fiber, actionQueue, setState, payload) {
26942694
? ((fiber = { payload: payload, next: null }),
26952695
(fiber.next = actionQueue.pending = fiber),
26962696
runFormStateAction(actionQueue, setState, payload))
2697-
: (fiber.next = { payload: payload, next: fiber.next });
2697+
: (actionQueue.pending = fiber.next =
2698+
{ payload: payload, next: fiber.next });
26982699
}
26992700
function runFormStateAction(actionQueue, setState, payload) {
27002701
var action = actionQueue.action,
@@ -9024,7 +9025,7 @@ var devToolsConfig$jscomp$inline_1032 = {
90249025
throw Error("TestRenderer does not support findFiberByHostInstance()");
90259026
},
90269027
bundleType: 0,
9027-
version: "18.3.0-canary-05fbd1aab-20231023",
9028+
version: "18.3.0-canary-b8e47d988-20231023",
90289029
rendererPackageName: "react-test-renderer"
90299030
};
90309031
var internals$jscomp$inline_1225 = {
@@ -9055,7 +9056,7 @@ var internals$jscomp$inline_1225 = {
90559056
scheduleRoot: null,
90569057
setRefreshHandler: null,
90579058
getCurrentFiber: null,
9058-
reconcilerVersion: "18.3.0-canary-05fbd1aab-20231023"
9059+
reconcilerVersion: "18.3.0-canary-b8e47d988-20231023"
90599060
};
90609061
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90619062
var hook$jscomp$inline_1226 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<55d6fdb51293e0bfc3d0f87e833cd9af>>
10+
* @generated SignedSource<<a02b9b5dea9f5b94464f6051b23b425e>>
1111
*/
1212

1313
"use strict";
@@ -2714,7 +2714,8 @@ function dispatchFormState(fiber, actionQueue, setState, payload) {
27142714
? ((fiber = { payload: payload, next: null }),
27152715
(fiber.next = actionQueue.pending = fiber),
27162716
runFormStateAction(actionQueue, setState, payload))
2717-
: (fiber.next = { payload: payload, next: fiber.next });
2717+
: (actionQueue.pending = fiber.next =
2718+
{ payload: payload, next: fiber.next });
27182719
}
27192720
function runFormStateAction(actionQueue, setState, payload) {
27202721
var action = actionQueue.action,
@@ -9450,7 +9451,7 @@ var devToolsConfig$jscomp$inline_1074 = {
94509451
throw Error("TestRenderer does not support findFiberByHostInstance()");
94519452
},
94529453
bundleType: 0,
9453-
version: "18.3.0-canary-05fbd1aab-20231023",
9454+
version: "18.3.0-canary-b8e47d988-20231023",
94549455
rendererPackageName: "react-test-renderer"
94559456
};
94569457
var internals$jscomp$inline_1266 = {
@@ -9481,7 +9482,7 @@ var internals$jscomp$inline_1266 = {
94819482
scheduleRoot: null,
94829483
setRefreshHandler: null,
94839484
getCurrentFiber: null,
9484-
reconcilerVersion: "18.3.0-canary-05fbd1aab-20231023"
9485+
reconcilerVersion: "18.3.0-canary-b8e47d988-20231023"
94859486
};
94869487
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
94879488
var hook$jscomp$inline_1267 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-canary-05fbd1aab-20231023";
30+
var ReactVersion = "18.3.0-canary-b8e47d988-20231023";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,4 @@ exports.useSyncExternalStore = function (
580580
exports.useTransition = function () {
581581
return ReactCurrentDispatcher.current.useTransition();
582582
};
583-
exports.version = "18.3.0-canary-05fbd1aab-20231023";
583+
exports.version = "18.3.0-canary-b8e47d988-20231023";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ exports.useSyncExternalStore = function (
583583
exports.useTransition = function () {
584584
return ReactCurrentDispatcher.current.useTransition();
585585
};
586-
exports.version = "18.3.0-canary-05fbd1aab-20231023";
586+
exports.version = "18.3.0-canary-b8e47d988-20231023";
587587

588588
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
589589
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
05fbd1aab036ecbd14469d6376024439bc931f68
1+
b8e47d988eb3ba547c102c0b12c351250ed955e0

0 commit comments

Comments
 (0)