Closed BrianHung closed 9 months ago
Hey @BrianHung - sorry this has sat for so long, been the busy season for me, but I have a little more time over the coming weeks and with 5.2.0
released today, I'd love to close out some PRs and get us ready for some new releases.
When you get a chance, will you please update the description here and talk about the why of this PR? From there, we'll also need some tests and documentation updates (unless this is fixing a bug where we already have test coverage/documentation for the behavior).
Thanks!
@BrianHung Any update??
@chakrihacker Just updated the PR description. Will try to write a test. I have added a test.
🍾 🥳 Thanks @BrianHung! I really appreciate it! Makes sense and LGTM. This'll make it into the next release. I'm probably going to release the next version after the repo restructure, so make sure those changes allow us to ship the way we have been for the most part.
This PR fixes a bug in
resolveNodeByPathParts
where whengetChildNode
throws a fail andfailIfResolveFails=false
,undefined
was not returned. Instead,resolveNodeByPathParts
let that error propagate through.Each of these complex types has the ability to fail and throw an error.
https://github.com/mobxjs/mobx-state-tree/blob/01d0fff5ba5f72a0b517582099ea3be05b4e1936/packages/mobx-state-tree/src/types/complex-types/map.ts#L326
https://github.com/mobxjs/mobx-state-tree/blob/01d0fff5ba5f72a0b517582099ea3be05b4e1936/packages/mobx-state-tree/src/types/complex-types/array.ts#L161
https://github.com/mobxjs/mobx-state-tree/blob/01d0fff5ba5f72a0b517582099ea3be05b4e1936/packages/mobx-state-tree/src/types/complex-types/model.ts#L637