Logical flaw in code
Basically the child paths of the folder is always missing the folder name of the folder being moved in child's new path's part even though the new path is only syntactically valid and it should not be missing it, also the unit test case passes even though it shouldn't.
https://pastebin.com/G8rEt4xb
7 Replies
Also apart from that its doing what its supposed to do and the updated path of the folder being moved is correct
Also if the updated child folder's path does not miss the folder being moved's name at its appropriate place in the path then the updated child folder's path would be entirely correct which is also the goal of fixing this issue
js realized i need to sleep rn but id appreciate any help:)
help pls my brain feels slightly cooked
In the MoveFolder method, the folder.FolderPath is updated to newFolderPathOfFolder, but this should be passed to UpdateChildPaths instead of newFolderPath.
In the UpdateChildPaths method, the replacement of oldp with newp might not include the folder name correctly. Ensure newp includes the folder name.
ohhhhhhhhhhhhhh
so
await UpdateChildPaths(folder, previousFolderPath, newFolderPathOfFolder);
should be enough to fix the issue right
tysm I think it will fix it. PS: That means theres very similar fault in unit test of that function tooI did not focus to much on your test code.
its alr I think it has pretty much same issue thats why it was passing but first imma test out the actual function
actually if I remember correctly in the assertion part of unit test I did not assert the updated child paths so its possible unit test has no issue
I was thinking that as well.
oh
btw I forgot to confirm but its working as expected now and unit tests are still passing