Closed kxxt closed 1 year ago
Should we not instead try to use the references correctly? I guess adding and deleting contacts can stay as it is, but updating needs a second thought? It will double the data stored if we add clones.
Should we not instead try to use the references correctly? I guess adding and deleting contacts can stay as it is, but updating needs a second thought? It will double the data stored if we add clones.
If the contact object is updated in the real address book first. Then when our code updates the virtual address book, the same contact object will get updated twice. So we need to ensure that our functions such as addContactToCategoryInCache
works without bugs(IIRC some of these functions rely on the categories field in contact object) even if the categories field stored in the contact is already updated. We need to document this in the code. Feel free to choose one way you like.
We should create a clone of the contact when creating the all-contacts address book because we intend to update them separately. It will become a footgun that is hard to debug if the virtual addressbook and real addressbook is referencing the same contact object.