Move folder instead of delete#1362
Conversation
| @@ -0,0 +1,61 @@ | |||
| #pragma once | |||
There was a problem hiding this comment.
Tested with a folder with 500 items and took 0.02s.
| const mkdirMock = vi.mocked(mkdir); | ||
| const renameMock = vi.mocked(rename); | ||
| const rmMock = vi.mocked(rm); |
There was a problem hiding this comment.
Has the rule against using vi.mock been abolished? Because here you could use deepMocked to mock the functions in fs/promises.
There was a problem hiding this comment.
True, you are right, changed.
| props.locals = new Map(); | ||
| // When | ||
| await deleteItemPlaceholder(props); | ||
| await deleteItemPlaceholder(props as any); |
There was a problem hiding this comment.
Why is this type assert necessary now when it wasn't necessary before?
There was a problem hiding this comment.
I'm a trying with a new way by using TestProps in the let props instead of using mockProps. So now the type is Partial and needs to casting to any.
|



What
Currently when a folder was deleted in cloud we were deleting it in local using
trash. However, this had 2 issues:deleteevents that could imply deleting files in the cloud (however just the root folder was deleted).To solve the first issue we have implemented a C++ solution that iterates the folder and checks for non placeholder items. I've added a test that tests against an empty folder, a folder with all placeholders (dehydrated and hydrated) and also with a file that is not a placeholder.
To solve the second issue first we move the folder to a temporal folder in the same volume called
C:/.internxt_trashand then we send it to the trash, so we just receive onedeleteevent.