cozy / cozy-stack

Simple, Versatile, Yours
https://docs.cozy.io/en/cozy-stack/
GNU Affero General Public License v3.0
1.11k stars 137 forks source link

Add a reference to sourceAccountIdentifier #4360

Closed nono closed 4 months ago

nono commented 4 months ago

When the stack executes a konnector that imports files, it checks that a directory exists for those files. And if the directory doesn't exist, it creates it. We have added a referencedBy on the directory for the sourceAccountIdentifier to be able to deal with several accounts for the same konnector, as each account should have its own directory.

nono commented 4 months ago

It seems that we'll need a data migration to add the SourceIdentifier in the Metadata of all accounts, no?

Most of the accounts already have a sourceAccountIdentifier.

Otherwise we'll never match any folder with its konnector?!

No, we can match even without it. Most often, we are using the folder ID from the trigger, but even without it, we can match the folder.