monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.37k stars 2.13k forks source link

Reminders missing for additional users #6134

Open Ian2020 opened 2 years ago

Ian2020 commented 2 years ago

When you add a new user they do not get reminders for any existing contacts. They only get reminders for new contacts or contacts that are edited AFTER the new user has been added.

The following SQL will find any contacts for whom user_id=1 has a reminder in reminder_outbox but user_id=2 does not:

select distinct contact_id, first_name, last_name, nickname,
       reminders.initial_date, reminders.title
from reminder_outbox
inner join reminders on reminder_outbox.reminder_id = reminders.id
inner join contacts on reminders.contact_id = contacts.id
where user_id = 1 and
     reminder_id not in
       (select reminder_id from reminder_outbox where user_id = 2);

On my self-hosted instance (latest Monica version 3.7) I found several rows i.e. reminders missing from my second user who was added after my initial import.

To fix this I edited each contact and disabled/re-enabled the annual birthday reminders and this forced the creation of the correct entries in reminder_outbox for my second user.

I suggest that at the point when a new user is added that all of the existing user's reminders are copied to the new user so they are in sync.

OddSquirrel commented 3 months ago

While this may be an older post, I just noticed the same behavior. Users that are invited after reminders have been set up will not see them. After deleting and re-adding it, the reminder shows for all current users.