New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equality check on Json.Decode.oneOf always returns true #904

Open
shuhei opened this Issue Sep 2, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@shuhei

shuhei commented Sep 2, 2017

Currently any pair of oneOf decoders are equal in the equality check that is used for diffing in virtual-dom. Because of this, changes in oneOf decoders are not reflected in event handlers of DOMs. (An example on Ellie)

Equality of two oneOf decoders are checked with _Json_listEquality(), which expects JavaScript arrays of decoders. However, a oneOf decoder has an Elm List of decoders instead of a JavaScript Array. Because of this, the len variable below becomes undefined given oneOf decoders, and the function always returns true for oneOf decoders.

https://github.com/elm-lang/core/blob/bc067c8e3db20235fc275b1d825bb76f365a1509/src/Elm/Kernel/Json.js#L378-L398

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Sep 2, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Sep 2, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@shuhei shuhei referenced a pull request that will close this issue Sep 2, 2017

Open

Fix equality check of oneOf decoder #905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment