Gaia/Contacts/Data Refactor: Difference between revisions

Jump to navigation Jump to search
Line 45: Line 45:


=== Principles ===
=== Principles ===
* There are many apps capable of providing contacts, each app should:
==== Contact Providers ====
** Be the owner of their own information (CRUD).
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:
** Provide a datastore name ''contacts'' with the information it shares.
* 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.
** That datastore will have a unique index per contact as key and a *mozContact* object as value.
* 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.


* There will be an app without UI that will:
==== Global Contacts DataStore (GCDS) ====
** Provide a '''datastore, Global Contacts Datastore (GCDS)''', that gives a vision of all contacts in the different datastores (applications) of the system.
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:
** '''Merge passively''' contacts that are detected to be the same ones.
* 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.
** Will offer '''pointers''' to the data in the '''original datastores'''.
* 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.
* 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.
* '''Listen to changes''' in other datastores to keep the whole view unified.
** Able to '''unmerge''' contacts references on demand.
* Able to '''unmerge''' contacts references on demand.


* Local contacts
==== Local contacts ====
** Will continue using mozContacts API.
* 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.
** A new '''system Datastore''' will be provided '''with the local contacts''' contained in mozContacts API.
* 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 APP
==== Contacts Data Consumer ====
** As any other client app of the GCDS will need to build their own indexedDB to be able to list and search information.
* 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]]
** Create specific indexes to make current requirements being searchable (name, given, family, org, tel, email, phonetic, address ...)
* 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.
** Use directly indexedDB to provide a better peforming contacts list (jump to letter, better cursor walking ...).


== Data flows ==
== Data flows ==
Confirmed users
483

edits

Navigation menu