Fix differ issues from json->edn conversion #7565
Merged
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.
Closes #7424.
Would be handled by #7564 but that's a mess and would break all game histories, so that's on pause.
Differ handles sequential types in a special way, with
:+
meaning "insert at the end". Our reliance on json means that it was always being treated as"+"
and thus differ would ignore it. I believe this has infected every portion of the entire frontend as long as we've used differ, but it's only surfaced here cuz we tend to ignore nils everywhere lol.The result of this bug would be that the diff from the waiting prompt to the choices prompt would have
:choices ["+" {:value {:title "Overseer Matrix" ...} ...} "+" {:value {:title "Overseer Matrix" ...} ...} "+" {:value {:title "Overseer Matrix" ...} ...} "+" {:value {:title "Yakov Erikovich Avdakov" ...} ...}]
, and thus be rendered incorrectly because you can't destructure a string. With this fix, it'll now just be the correct values merged in to their right place.Having written all of this out, I have also updated the
prompt-state
differ stuff to be smarter, borrowing code from #7564.