Confirmed users
483
edits
mNo edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
== Current situation == | == Current situation == | ||
The current Contacts app has been growing with time around the [https://wiki.mozilla.org/WebAPI/ContactsAPI | The current Contacts app has been growing with time around the [https://wiki.mozilla.org/WebAPI/ContactsAPI MozContacts API], started like a simple application but has been adding more and more requirements. | ||
It was not just the only FirefoxOS app using this API, so | It was not just the only FirefoxOS app using this API, so MozContacts end up trying to support several requirements from different applications, and at the end of the day what we have is a store for vCard objects, which limited search capabilities. | ||
With the inclusion of external contacts sources like Facebook, Gmail, Hotmail, vCard from SDCard, bluetooth and so on, we have been extending the use of the API via hacks and dark techniques. | With the inclusion of external contacts sources like Facebook, Gmail, Hotmail, vCard from SDCard, bluetooth and so on, we have been extending the use of the API via hacks and dark techniques. | ||
Also we added a great feature like contacts merging, everything working under the same | Also we added a great feature like contacts merging, everything working under the same MozContacts API. | ||
=== Problems === | === Problems === | ||
| Line 13: | Line 13: | ||
* Contacts list performance: | * Contacts list performance: | ||
** Due to the design of | ** Due to the design of Contacts app, we should be able to jump to letters and scroll super fast with the letter shortcuts. It wasn't right to add application specific requirements to MozContacts API so we have been doing black magic to keep the performance at 60fps when loading huge amount of contacts (> 2000). | ||
* Search restrictions: | * Search restrictions: | ||
| Line 19: | Line 19: | ||
* Impossible to unmerge contacts: | * Impossible to unmerge contacts: | ||
** During the process of merging contacts we end up loosing the information of the original contacts as we only have a | ** During the process of merging contacts we end up loosing the information of the original contacts as we only have a MozContacts API to store this information. So there is no way to unmerge contacts. | ||
* Dependency with Facebook integration: | * Dependency with Facebook integration: | ||
** | ** We want other apps different than the Contacts app to be able to read the contacts data imported from external sources like FB, Hotmail, Gmail, etc. However, we have legal restrictions that avoid us to share the data imported from FB with an app that is not owned by Gaia. This made us take this restricted data out of the MozContacts API because this API is accessible by privileged apps. Initially we had to create an independent IndexedDB with FB information that used to live in the Communications app, but once we were able to use the DataStore API we moved this data to a shared DataStore. So now consumers of contacts information that are interested on FB data need to query the MozContacts API and the FB datastore. | ||
* Hard to integrate with 3rd party contacts providers: | * Hard to integrate with 3rd party contacts providers: | ||
** We added extra support for Gmail and Hotmail contacts but this is embedded in the Contacts application itself, which is not scalable. We want to make any app capable of providing contacts to have a seamless integration with the Contacts APP. | ** We added extra support for Gmail and Hotmail contacts but this is embedded in the Contacts application itself, which is not scalable. We want to make any 3rd party app capable of providing contacts to have a seamless integration with the Contacts APP. | ||
== Architecture == | == Architecture == | ||
=== Current context === | === Current context === | ||
* mozContacts API | * mozContacts API | ||
** Right now is frozen, we know that and will be for good a nice way of storing contacts locally, but we won't be able to add extra requirements. | ** Right now is frozen, we know that and will be for good a nice way of storing contacts locally, but we won't be able to add extra requirements. | ||
* DataStore API | * DataStore API | ||
** The [https://wiki.mozilla.org/WebAPI/DataStore Datastore API] is a new API designed to make apps share information or making them collaborate to add data to a common store. It allows synchronization and being able to notify about changes. It's a pretty simple key/value store, where both key and value can be any kind of | ** The [https://wiki.mozilla.org/WebAPI/DataStore Datastore API] is a new API designed to make apps share information or making them collaborate to add data to a common store. It allows synchronization and being able to notify about changes. It's a pretty simple key/value store, where both key and value can be any kind of object, and it doesn't implement any kind of search, just direct access by key. | ||
=== Proposal === | === Proposal === | ||
==== Data flow ==== | ==== Data flow ==== | ||
===== High level overview ===== | |||
[[File:IMG 20140619 162203.jpg|800px|x600px]] | [[File:IMG 20140619 162203.jpg|800px|x600px]] | ||
[[File:Contactsrefactor.png|800px|x600px]] | |||
==== Principles ==== | ==== Principles ==== | ||