cozy-data-system
cozy-data-system copied to clipboard
"Vital" doctypes should be created by the DataSystem and not the Home
Doctypes like cozyinstance, user, stackapplication, etc.
Creating them with the DataSystem can lead to a problem if the Home is started before the DataSystem.
This would prevent random problem for user installing Cozy with the Debian or Arch packages.
Mmmmm... I'm not sure. Home can't start without data-system. So, it doesn't work if home starts before data-system (with "Vital" view or not).
I'll have to try it again on my side (new comp, doesn't have my install scripts with me, will have to copy them when I can access to my old one), but I'm pretty sure to remember that the home wasn't returning any error when started before the data-system.
Home begins by view creations, so if data-system isn't started before home, it cannot create his views. Thus, create 'Vital' docType can help for some home actions but it's not enough. Home needs lots of request. In my mind, it isn't logical to create, as an example, file/byImage in data-system.
For me, problem is more "force home to start after data-system" (controller should ensure that) than "declare 'Vital' docType in data-system".
However, separate 'common' and 'vital' docType seems a good idea for permissions. Indeed, as an example, only home should access to docType 'Access' which contains applications token even if an application has 'Access' in his permissions.
Sure, forcing the start of the home after the data-system can be a valid solution too. Indeed, having this kind of separation between doctypes could increase the platform's security.