Skip to content

Commit 2db6c08

Browse files
committed
fix: loadActual cleanup
While looking at the target setter for nodes, it seemed odd that we were making affordances for sometimes setting a promise as the target. After unraveling the code, it turns out this is impossible outside of tests, where we set environment variables to mimic that state. We were always awaiting the generation of links/nodes where appropriate. This commit inlines some code and cleans it up to the point where this fact could be verified, and then removes the now unneeded logic in loadActual that was trying to account for this. loadActual, an async function, now returns a promise that resolves to the tree, as a singleton. This maintains the use case commented on where buildIdealTree and reify can happen in parallel. This fixes a potential bug in reify (and likely others) which pass around this.idealTree as an object, and NOT a promise, even though before this refactor it can sometimes be a promise.
1 parent 49bbb2f commit 2db6c08

File tree

1 file changed

+196
-233
lines changed

1 file changed

+196
-233
lines changed

0 commit comments

Comments
 (0)