Confirmed users
483
edits
(More on Potential desynchronization) |
(→Platform requirements: scheduler) |
||
| Line 107: | Line 107: | ||
* '''Potential performance foot gun''' | * '''Potential performance foot gun''' | ||
When a Contact Provider is changed, this triggers a datastore-change-* notification observed by the GCDS app, which is woken up. The GCDS makes its corresponding changes in its datastore which triggers a new datastore-change-* notification which is observed by every single Contact Consumer in the device. This means that we will be opening at the very least the six apps that are listed [[Gaia/Contacts/Data_Refactor#Contacts_data_consumers_.28in_Gaia.29|here]] in a very short period of time, which will certainly cost a considerable peak of memory and might even kill the GCDS or force the killing of any of these Contact Providers causing the desynchronization mentioned above. | |||
To avoid this we could: | |||
* Simply not observe the datastore-change-* system message on Contact Consumers. Instead, Contact Consumers will need to do a DataStore.sync() to synchronize with the GCDS every time they are opened. | |||
* Send the datastore-change-* system message '''only to certified''' apps. This will limit the number of Contact Consumers that will be woken up and we can control that they close themselves after the sync is completed, if still want to observe the datastore-change-* notification. | |||
* Add some kind of scheduler for these notifications so they will be delivered in a controlled way when we detect that there is enough memory to wake new apps. | |||
=== DataStore permission model === | === DataStore permission model === | ||