-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
@redux-devtools/extensions
There is an issue when a reviver
is set inside of devtools extensions serialize
options and serialize
option immutable
is not set.
Reviver will never get called if immutable is not set.
It seems that the conditional is somehow mixed up due to typescript migration (#756).
Before the condition was checking for serialize.reviver
now it checks for !!serialize.immutable
. This is probably a mistake since function name is isSerializeWithReviver
and also because the function isSerializeWithImmutable
is returning exactly the same condition.
See js code before with serialize.reviver
check:
redux-devtools/extension/src/app/api/importState.js
Lines 30 to 32 in 326cfdf
} else if (serialize.reviver) { | |
parse = (v) => jsan.parse(v, serialize.reviver); | |
} |
and ts code afterwards with !!serialize.immutable
checking:
redux-devtools/extension/src/app/api/importState.ts
Lines 62 to 64 in a418284
} else if (isSerializeWithReviver(serialize)) { | |
parse = (v) => jsan.parse(v, serialize.reviver); | |
} |
redux-devtools/extension/src/app/api/importState.ts
Lines 33 to 37 in a418284
function isSerializeWithReviver( | |
serialize: boolean | SerializeWithImmutable | |
): serialize is SerializeWithRequiredReviver { | |
return !!(serialize as SerializeWithImmutable).immutable; | |
} |
Here you can see that the return of both functions isSerializeWithReviver
is exactly the same isSerializeWithImmutable
redux-devtools/extension/src/app/api/importState.ts
Lines 23 to 27 in a418284
function isSerializeWithImmutable( | |
serialize: boolean | SerializeWithImmutable | |
): serialize is SerializeWithRequiredImmutable { | |
return !!(serialize as SerializeWithImmutable).immutable; | |
} |