Immutable setIn is broken with more than 32 elements in an array. #3803
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue introduced in #3692 where the
mergeLists
method insetIn.js
forimmutable.js
was updated due tomergeDeepWith
being removed as aList
function inimmutable.js@4.0.0-rc.5
. Unfortunately this change introduced and error in which arrays with more than 32 elements were behaving unexpectedly since the new way of doing it didnt use ordered maps, instead just callstoMap()
, which causes the merging to lose order with more than 32 elements due to optimizations inimmutable.js
. After4.0.0-rc.5
, themergeDeepWith
-method is exported as a global export instead of being attatched toMap
, andList
. This PR uses the global export version4.x
and uses the old way of merging for users with3.x
. I also added a test with long arrays for immutablesetIn
.This PR should fix #3791
@erikras @gustavohenke can this be merged fast? Its pretty important since all long FieldArrays are currently broken.