Confirmed users
483
edits
| Line 76: | Line 76: | ||
| == Platform requirements == | == Platform requirements == | ||
| In order to do this we  | In order to do this we still have some requirements that needs to be implemented in the platform. | ||
| === Expose mozContacts API content as a datastore === | === Expose mozContacts API content as a datastore === | ||
| Line 82: | Line 82: | ||
| More background about this change can be read on this [https://groups.google.com/forum/#!topic/mozilla.dev.webapi/C2L9PdFMO7Q mailing list thread] and {{bug|1016838}}. | More background about this change can be read on this [https://groups.google.com/forum/#!topic/mozilla.dev.webapi/C2L9PdFMO7Q mailing list thread] and {{bug|1016838}}. | ||
| ===  | === Notification mechanism about datastore changes (aka DataStore onchange scheduler) === | ||
| The GCDS app needs to receive notifications about changes on the datastores owned by all the Contact Providers that are registered in the GCDS. To do that we have two ways of receiving this kind of notifications: | |||
| * Via the '''''onchange''''' event, that will be received by the GCDS '''while the app is running'''. | |||
| * Via the '''''datastore-change-*''''' system message, that the GCDS needs to listen to be '''woken up''' when a change in an observed datastore is identified. This system message was added on {{bug|1014023}} | |||
| We believe that these two mechanisms are not enough to fulfill the needs of the proposed architecture the way they are implemented right now for the following reasons. | |||
| * '''There is no way to know when a new Contact Provider is added''' | |||
| In order to add a new Contact Provider datastore information and its corresponding contained data pointers to the list of providers stored in the GCDS we need to be notified about new installed apps exposing a datastore named ''contacts''. | |||
| Currently, we are able to request a list of all the datastores with an specific name from the GCDS app, but to do that the GCDS needs to be opened. And this only happens when a contact is changed in any of the already registered Contact Providers, which could happen immediately, next month or never. So we need a way to wake the GCDS up to do the proper registration of the new installed Contact Provider. We can simply trigger the datastore-change-* notification as soon as we detect a new datastore named X. The GCDS will be responsible to look for not already registered Contact Providers once it is woken up by the system message. | |||
| * '''Potential desynchronization between Contact Providers content and GCDS''' | |||
| Because we have no way to acknowledge the reception and completion of the processing of a change notification we may have an scenario where: | |||
| # A bunch of contacts are added and removed from a Contact Provider being watched by the GCDS. This triggers the ''datastore-change-*'' notification. | |||
| # The GCDS wakes up as response to the ''datastore-change-*'' notification. | |||
| # The GCDS starts syncing with the observed Contact Provider datastore. | |||
| # The GCDS is killed by the system. | |||
| # We loose these changes :( | |||
| * '''Potential performance foot gun''' | |||
| === DataStore permission model === | === DataStore permission model === | ||