8000 feat: Now create destination folders before saving files by doubleface · Pull Request #973 · konnectors/libs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Now create destination folders before saving files #973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 24, 2023

Conversation

doubleface
Copy link
Collaborator
@doubleface doubleface commented Nov 10, 2023

And folders are created only for files which will be downloaded (this avoids creating empty folders when files already exist elsewhere).

This avoids many requests to the stack for each imported files and saves a lot of time

If the destination folder was removed, throw a specific error to let the
flagship app handle the situation (recreate the destination folder,
update the trigger with folder_to_save, etc)

I finally did not need any folder map, since cozy-client has it's own with ensureDirectoryExists

@doubleface doubleface requested a review from a team as a code owner November 10, 2023 11:42
@doubleface doubleface force-pushed the feat/DestinationFolderOptimization branch from af792c8 to a04d682 Compare November 13, 2023 09:11
@doubleface doubleface force-pushed the feat/DestinationFolderOptimization branch 7 times, most recently from 3932774 to e35e219 Compare November 15, 2023 09:38
@doubleface doubleface force-pushed the feat/DestinationFolderOptimization branch from e35e219 to 9407d68 Compare November 23, 2023 13:51
doubleface added 3 commits November 23, 2023 15:08
This avoids many requests to the stack for each imported files and saves
a lot of time

If the destination folder was removed, throw a specific error to let the
flagship app handle the situation (recreate the destination folder,
update the trigger with folder_to_save, etc)
- postProcess has never been used in clisk konnectors and there are another mean to modify the content of files : downloadFileInWorker
- entry.fetchFile comes from node konnectors and this is exactyly the role of downloadFileInWorker
@doubleface doubleface force-pushed the feat/DestinationFolderOptimization branch from 9407d68 to ee45891 Compare November 23, 2023 14:10
doubleface pushed a commit to cozy/cozy-flagship-app that referenced this pull request Nov 23, 2023
When this even occurs, it means that the main destination folder of the
konnector has been removed during konnector execution.

In this case, we :
 - Regenerate the files index
 - create the destination folder according to the manifest
 - update the trigger with the new message.folder_to_save attribute
 - retry saveFiles

see konnectors/libs#973
doubleface pushed a commit to cozy/cozy-flagship-app that referenced this pull request Nov 23, 2023
When this even occurs, it means that the main destination folder of the
konnector has been removed during konnector execution.

In this case, we :
 - Regenerate the files index
 - create the destination folder according to the manifest
 - update the trigger with the new message.folder_to_save attribute
 - retry saveFiles

see konnectors/libs#973
Copy link
Contributor
@Crash-- Crash-- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work ! If you import the .default for the cozy-client type, then you can remove all the @ts-ignore

@doubleface doubleface merged commit b94c1fe into master Nov 24, 2023
@doubleface doubleface deleted the feat/DestinationFolderOptimization branch November 24, 2023 13:38
doubleface pushed a commit to cozy/cozy-flagship-app that referenced this pull request Nov 24, 2023
When this even occurs, it means that the main destination folder of the
konnector has been removed during konnector execution.

In this case, we :
 - Regenerate the files index
 - create the destination folder according to the manifest
 - update the trigger with the new message.folder_to_save attribute
 - retry saveFiles

see konnectors/libs#973
doubleface pushed a commit to cozy/cozy-flagship-app that referenced this pull request Nov 24, 2023
When this even occurs, it means that the main destination folder of the
konnector has been removed during konnector execution.

In this case, we :
 - Regenerate the files index
 - create the destination folder according to the manifest
 - update the trigger with the new message.folder_to_save attribute
 - retry saveFiles

see konnectors/libs#973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0