use link id instead of cloud id in the activity table. repair broken activity items on activation.