Skip to content
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

feat: Send existing files index to pilot fetch #1089

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

doubleface
Copy link
Contributor

This index is sent only if the konnector has a permission on
io.cozy.files, to avoid unneccessary requests.

This existing files index is needed to have shouldReplaceFile
functionnal in konnectors. But shouldReplaceFile won't throw if it is
not present.

Checklist

Before merging this PR, the following things must have been done:

  • Faithful integration of the mockups at all screen sizes
  • Tested on iOS
  • Tested on Android
  • Localized in English and French
  • All changes have test coverage
  • Updated README & CHANGELOG, if necessary

const serializableExistingFilesIndex =
Object.fromEntries(existingFilesIndex)
pilotContext.existingFilesIndex = serializableExistingFilesIndex
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the flagship app will have more and more to check the permissions. We should start creating a new domain (aka folder) to deal with that instead of adding the complexity here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Crash-- @acezard I updated the code to have a manifest domain. I think this is ready.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a wrapTime to that method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A wrapTime to _start or hasPermission ? I'm not sure

Copy link
Contributor

Choose a reason for hiding this comment

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

getExistingFilesIndex ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already done :

this.getExistingFilesIndex = wrapTimer(this, 'getExistingFilesIndex')

This index is sent only if the konnector has a permission on
io.cozy.files, to avoid unneccessary requests.

This existing files index is needed to have `shouldReplaceFile`
functionnal in konnectors. But shouldReplaceFile won't throw if it is
not present.
@doubleface doubleface merged commit cc413d9 into master Jan 15, 2024
1 check passed
@doubleface doubleface deleted the feat/existingFilesIndex branch January 15, 2024 08:17
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