tutao / tutanota

Tuta is an email service with a strong focus on security and privacy that lets you encrypt emails, contacts and calendar entries on all your devices.
https://tuta.com
GNU General Public License v3.0
5.97k stars 513 forks source link

Deleted Calendar Entry that was repeating on a weekly basis with push notification reminders still pops up after deletion #4264

Open JOPloume opened 2 years ago

JOPloume commented 2 years ago

Describe the bug A deleted calendar entry still throws reminders after deletion. As the original event was set to re-occurr on a weekly basis, I am receiving every week still reminders for an event that does not exist anymore. This is really bothersome and makes the usage of the calendar app very annoying.

To Reproduce Steps to reproduce the behavior:

  1. Create Calendar Entry the re-occurs with a daily/weekly frequency and create reminders for it (e.g. 5 mins before)
  2. Test to see if you get push notifications
  3. If reminders work, delete this event by clicking on the event and pressing the trash button
  4. See the error of still receiving the push notifications

Expected behavior When an event is deleted, also automatically its set reminders should be deleted.

Screenshots /

Smartphone (please complete the following information): - not so interesting, as the same error occurs on my MacOS Desktop App

Additional context This is an error happening in my account on both mobile and desktop app, so I assume it is a cross-device issue.

charlag commented 2 years ago

Hi Thanks for the report, we have heard about such cases but we struggle to reproduce it so far.

JOPloume commented 2 years ago

Hi Thanks for the report, we have heard about such cases but we struggle to reproduce it so far.

@charlag Why do you struggle to reproduce it? It happens for me both on my Desktop app and my phone, so this is not an Android bug per se. Does it not happen to you when you follow my steps to reproduce?

charlag commented 2 years ago

@JOPloume we are struggling because none of the reproduction steps work for us. There must be some difference in the environment.

ne0zepG commented 2 years ago

@charlag I have the same issue. I already had sent an email (almost 3-weeks ago) raising this bug and it has been left unattended for the time being. I replied on that email thread again with the attachments (photos and screen recording) of this bug. The way I created this bug is through these steps -

  1. There must be only 1 calendar profile (I used the default Private one).
  2. Create a recurring event (I created a monthly recurring event and I will get notified 30-mins before that event). Please also keep in mind that this is not only a one recurring event I created. I had created multiple or a few.
  3. Delete the default Private calendar profile. NOT THE EVENT/s you created. I mean, the whole default Private calendar profile. After deleting the default Private calendar profile, a Private default one will be again re-created (this one has no events of course).
  4. Now, a notification of the deleted events will still notify through the android app and Windows desktop client.

Steps are done using Tutanota Windows desktop client. Though I forgot which version initially did.

Let me know if you need futher information.

charlag commented 2 years ago

@ne0zepG thank you, this is very helpful. We will try to reproduce it.

JOPloume commented 2 years ago

@charlag Hey, are there already any updates on the issue? :)

charlag commented 2 years ago

Hi, sorry, we didn't get to it yet but hopefully will soon

JOPloume commented 1 year ago

@charlag Hey, were you able to reproduce this issue and are there any updates on this? :)

charlag commented 1 year ago

@JOPloume it's pretty high priority, we did not start fixing it yet unfortunately

ne0zepG commented 1 year ago

@charlag Were you guys able to reproduce this bug? Because I have just received an event notification (Desktop client v3.100.2) from a deleted entry (which was deleted months ago as per my first comment above ^).

charlag commented 1 year ago

I haven't been able to reproduce it with native alarms (on desktop) but I've found a bug where the browser wouldn't unschedule alarms when the calendar is deleted

SkypLabs commented 1 year ago

I have the same issue for months now, with the particularity that I receive not only one but multiple notifications for a single deleted event as you can see on the screenshot:

_20221228_193017.JPG

kib42 commented 1 year ago

Report from a user:

On my mobile phone I had a notification which every two weeks (on Tuesday) was displaying a reminder. This notification was created in a dedicated calendar. After this calendar was removed the reminder is still being displayed.

JOPloume commented 1 year ago

@charlag it would be really great to get feedback when you are tackling this. Because I have updated the applications since the first appearance of this issue multiple times and still get every time a notification for a long deleted event.

charlag commented 1 year ago

So far we struggle to reproduce it. It must be that delete event for alarm is somehow lost but hard to say how it happens so far.

JOPloume commented 1 year ago

Interesting...Can I ask the following questions:

JOPloume commented 1 year ago

Or a last question: Could I send to someone at Tutanota in private a message with my email address and the name of the event that causes for me this issue? So the event could be permanently deleted from the database?

charlag commented 1 year ago

@JOPloume I will try to explain in detail how it works, maybe it will be helpful to both of us.

There are calendar events that are stored in a list specific to the calendar. There are alarms that are stored in a list specific to the user. Neither of these are directly used for scheduling alarms in native apps.

When the event is created (or deleted) we encrypt a special message with a special key (push identifier session key, a device-specific key) and send it to each device ("send" means writing to a special per-device list from which the device will pick it up on either notification from us or on startup). The device downloads the message and stores is locally. It also schedules (or unschedules) one or more occurrences of the alarm. If event is repeating the device will keep scheduling new alarms periodically.

If the event is deleted but the alarm is still there it is most likely that the device still has the local copy of the event and keeps scheduling the alarm. In this case we would need to find out why it is still there.

To test whether it is true you would need to either clear all data or to reinstall the app and see if you still get the notification. If it's still there it means that the alarm is really still on the server, otherwise it's a local state problem.

I hope this helps, feel free to write to hello@tutao.de with any info that is relevant. We've tried over number of versions over the long period of time with no luck. The event structure nor alarm code changed recently.

SkypLabs commented 1 year ago

Or a last question: Could I send to someone at Tutanota in private a message with my email address and the name of the event that causes for me this issue? So the event could be permanently deleted from the database?

Keep in mind that all your data is end-to-end encrypted, which means people at Tutanota can't see anything from your calendars. Even if you PM them your e-mail and event name, they won't be able to do anything with them.

To test whether it is true you would need to either clear all data or to reinstall the app and see if you still get the notification.

I just did. Let's see if this solves the issue. I'll keep you posted.

SkypLabs commented 1 year ago

To test whether it is true you would need to either clear all data or to reinstall the app and see if you still get the notification.

I confirm that clearing all local data before logging in again fixed the issue for me.

JOPloume commented 1 year ago

@charlag Wow, thanks for this detailed feedback, that totally makes sense now. Just received again the reminder push notification for my deleted event. Will do now as you suggested and delete & reinstall the app to clear the local data. Will keep you posted if it also works as for @SkypLabs 👍

JOPloume commented 1 year ago

I can confirm that reinstalling the app fixed the issue of receiving a reminder for a deleted calendar event for me. Thus, I will close the issue, thanks for all the help 🤗

charlag commented 1 year ago

We still didn't find the original cause so we would like to keep it open 😅

JOPloume commented 1 year ago

We still didn't find the original cause so we would like to keep it open 😅

@charlag Ah, alright! Sorry, than I reacted to fast, hehe.

charlag commented 1 year ago

We think there's at least one case when it can happen.

When PushIdentifier is deleted we do not proactively unschedule everything for the device, we rely on the fact that on the next fetch we will get authorization error and will reset the local state.

After we've changed the authorization mechanism it is enough for a single user to have the specified push identifier. This means that as long as there is another valid user added to the device we will not invalidate the data for other users. This means that alarms will never be unscheduled.

In addition this might still happen even if we log in as that user again. We will add the alarms again on the next login but it will only schedule existing ones. If there were some changes inbetween that should have unscheduled old alarms we will not apply them and alarm will be stuck.

We have not tried to reproduce it yet.