When a contact with a shared address from another contact updates their address via profile, address data can be lost or inconsistent
If you set Bob to use Julie's address and then Julie updates her address in a profile, Bob's address is updated as expected. However if Bob updates his address via profile, then Bob's address will be updated, but Bob's address will still be shown as using Julie's address (will still have the master_id, even though it is now different than the master address). This is inconsistent as Bob's address is actually now different from Julie's, so they no longer share an address.
If you then edit Bob's address and save it, Bob's address will be set back to Julie's address, losing the perhaps more current address that Bob had input in the profile (though at least in this case you can see what will happen if you are paying attention). Even worse, if you use Edit from the Contact Summary and save this form, you'll also revert Bob's address back to Julie's without it being evident that this is happening at all.
Two possibilities for the expected behaviour here:
- Both Bob and Julie should be able to update their shared address. In this case, if Bob submits a profile, we should update the shared address (even though it belongs to Julie).
- Bob should not be able to update the shared address, only Julie should be able to update the address. When Bob submits a profile with address fields, we compare the submitted values to the DB values and if they are different, we updated Bob's address only and change it so it is no longer a shared address (remove master_id).
I think option 1 is probably best, otherwise we would end up with shared addresses that become unshared frequently because someone will submit a profile anonymously that is deduped to an existing contact but they will write 3rd St instead of Third St or some other small change. I can see that some might want to have a shared address that can only be updated by the "owner" of the address, but I think it would be best to implement option 1 as the default behaviour and then if someone wants option 2, that could be implemented as a global and/or per address setting.