Confirmed users
483
edits
Line 45: | Line 45: | ||
=== Principles === | === Principles === | ||
==== Contact Providers ==== | |||
We want a generic mechanism for apps to share contact information and so became Contact Providers. An app that wants to share each contact information should: | |||
* Be the owner of their own information (CRUD). Contact Providers are the only responsible for adding, updating and removing contacts on their own stores. The Global Contact Data Store won't have write access to other provider's store. | |||
* Provide a readonly datastore named '''''contacts''''' with the information it shares. | |||
* That datastore will have a unique index per contact as key and a *MozContact* object as value. | |||
==== Global Contacts DataStore (GCDS) ==== | |||
This is the global hub of information about Contact Providers and the data they share. We will have a certified app with no UI that will do the following: | |||
* | * Provide a '''datastore, Global Contacts Datastore (GCDS)''', that gives a vision of all contacts in the different datastores owned by the different Contact Providers of the system. This global datastore will contain an entry for each and a pointer to the original contact source. | ||
* Merge '''passively''' contacts that are detected to be the same ones. '''Active''' merge (with UI) is responsability of each Contact Provider. | |||
* Provide a '''helper library''' for users to have the '''view of a single contact''' coming from it's different (or unique) sources. | |||
* '''Listen to changes''' in other datastores to keep the whole view unified. | |||
* Able to '''unmerge''' contacts references on demand. | |||
==== Local contacts ==== | |||
* A new '''datastore''' owned by the system will be provided and will contain the same contact related information stored in the MozContacts API indexed DB. | |||
* The content of this datastore will be modifiable via the existing MozContacts API only and the GCDS will treat this datastore as it treats any other datastore owned by any other Contact Provider. | |||
* Because the MozContacts API can be accessed by privileged apps, certified only data won't be added to this datastore. This is the case of FB data. | |||
* Contacts | ==== Contacts Data Consumer ==== | ||
* | * The Contacts app is considered a Contacts Consumer, just like the rest of the apps listed on [[Gaia/Contacts/Data_Refactor#Contacts_data_consumers_.28in_Gaia.29|Contacts Data Consumers in Gaia]] | ||
* Each consumer of the GCDS will need to build their own indexedDB from the data obtained through the GCDS and the datastore owned by the pointed Contact Providers. This indexedDB should contain the specific indexes required for the specific needs of the app like incremental searches, jump to letter, better cursor walking, etc. | |||
== Data flows == | == Data flows == |