Conversation
|
| @@ -0,0 +1,44 @@ | |||
| import { logger } from '@internxt/drive-desktop-core/build/backend'; | |||
There was a problem hiding this comment.
the behaviour of this handler is the same as the previous code inside ReleaseCallback, the only difference is that gives more context about what is really happening and providing better naming (For example const temporalFile = await findTemporalFile(path); instead of const document = await this.findDocument(path); at a first glance it is more explicit about the intention
| beforeEach(() => { | ||
| vi.clearAllMocks(); | ||
| }); |
There was a problem hiding this comment.
In the general test settings, cleanup after each test is already set by default, so there is no need to clean up the mocks.
| beforeEach(() => { | ||
| vi.clearAllMocks(); | ||
| }); |
There was a problem hiding this comment.
In the general test settings, cleanup after each test is already set by default, so there is no need to clean up the mocks.



What is Changed / Added
Extracted the find and upload temporal file logic from
ReleaseCallbackinto a dedicatedhandler. Added JSDoc on
TemporalFileand onReleaseCallbackto document the overall logicExtracted the
TEMPORAL_FOLDERINTERNXT_DRIVE_TMPto the dedicated Paths objectWhy
The original callback was doing too much with no named concepts, making it hard to follow when reading it. The JSDocs provides better context and the why behind the logic