Skip to content
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

Updating hooks break when keys have a .. #966

Closed
stutrek opened this issue Jan 8, 2020 · 0 comments · Fixed by #1130
Closed

Updating hooks break when keys have a .. #966

stutrek opened this issue Jan 8, 2020 · 0 comments · Fixed by #1130

Comments

@stutrek
Copy link

stutrek commented Jan 8, 2020

https://codesandbox.io/s/vigilant-knuth-e7dme

This code updates a key called is.good.friend, while a hook simply spreads the modifications object. The result is an object with is.good.friend as an object path.

@stutrek stutrek changed the title Update hooks break when keys have a .. Updateing hooks break when keys have a .. Jan 8, 2020
@stutrek stutrek changed the title Updateing hooks break when keys have a .. Updating hooks break when keys have a .. Jan 8, 2020
@dfahlander dfahlander added the bug label Jan 9, 2020
dfahlander added a commit that referenced this issue Sep 29, 2020
…hat contain dotted strings (#1130)

* Cleanup: ensure db.folks update hook is removed after unit test completes

* Do not extract nested paths from the object keys contained in middleware hook return values

Fixes #966

* Additional test for #1130

* Nit: trailing space

* Post-merge fixup

* Add explicit check for keys as literal property names on objects before intepreting them as paths

* Alternative approach: push logic down into setByKeyPath function

* Revert "Alternative approach: push logic down into setByKeyPath function"

This reverts commit d610245.

Co-authored-by: dfahlander <david.fahlander@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants