Closed Bug 1519964 Opened 6 years ago Closed 2 years ago

Reminder list is not refreshed properly when coming out of sleep if the reminder was already dismissed

Categories

(Calendar :: Alarms, defect)

Lightning 6.2.4
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: alexandre.f.demers, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Steps to reproduce:

Doing this with a linked Google Calendar

In TB:
Create an event
Add a reminder
Put the computer to sleep
Let the reminder date-time pass

On another device:
Dismiss the reminder
Or
Change the event (move it to a later date)

Back in TB:
Wake the computer

Actual results:

Thunderbird will pop up the Reminder dialog showing the triggered reminder.

  • if you try to dismiss it and it will warn you the event has changed. You can then reload the calendar or you can force to push the action.
  • if you wait in hope of seeing the Reminder list be refreshed automatically at some point in the future, this will never happen.

Expected results:

The Reminder should not have been listed in the Reminder dialog.

Secondly, if this can't be done, there

Proposed solutions:
The calendar should be updated automatically, which never happens. If more time has passed than the value set under Refresh calendar since the last checkup (when the computer is woken up), the calendar should be refreshed first.

Otherwise, Lightning should be able to identify if the event's reminder was simply dismissed elsewhere from another device. If so, it shouldn't show the reminder.

Also, since the Reminder dialog is the first thing showing up after a wake from sleep (it pops over everything else), a Refresh button action should be added to the Reminder dialog so we don't have to go through TB -> Calendar -> Reload calendars / Synchronize calendars.

I can confirm this bug is still present (using TB 78.12.0).

My observation is that in the situation described above Thunderbird will not attempt to synchronize the calendar anymore, even if you manually click the "Synchronize" button. There is no network connection attempt made to the CalDAV server. This is particularly annoying, because sometimes when dismissing the reminder, the "This event has been modified" dialog does not appear and Thunderbird silently overwrites the event with the old data, even if it has been changed on the server.

So the safest way to recover from this situation has always been for me to simply kill the Thunderbird process and restart, because Thunderbird will attempt to upload the event even when the reminder dialog is closed using the "x".

The weird thing is that Thunderbird will refresh all other calendars just fine. Only the one with the open reminder is left out.

The following log message appears for every calendar that does not synchronize anymore every time during the sync run:

Lightning: [calCachedCalendar] sync in action/pending. calCachedCalendar.js:314

To be precise, that message appears after the line:

Lightning: [calCachedCalendar] Performing playback operation delete on 0 items to CALENDARNAME calCachedCalendar.js:647

Before the "sync in action/pending" messages appear I always get this:

Lightning: [calStorageCalendar] Message: executeSyncItemStatement exception
Connection Ready: true
Last DB Error Number: 6
Last DB Error Message: database table is locked: cal_metadata
Database File: /home/thomas/.thunderbird/ktt3yiiz.default/calendar-data/cache.sqlite
Last DB Statement: [object AsyncStatementJSHelper]
Exception: [Exception... "Component returned failure code: 0x8052000e (NS_ERROR_FILE_IS_LOCKED) [mozIStorageStatement.executeStep]"  nsresult: "0x8052000e (NS_ERROR_FILE_IS_LOCKED)"  location: "JS frame :: resource:///modules/CalStorageCalendar.jsm :: executeSyncItemStatement :: line 241"  data: no]
1: [resource:///modules/CalStorageCalendar.jsm:2596] logError
2: [resource:///modules/CalStorageCalendar.jsm:243] executeSyncItemStatement
3: [resource:///modules/CalStorageCalendar.jsm:2483] setMetaData
4: [resource:///modules/CalDavCalendar.jsm:213] saveCalendarProperties
5: [resource:///modules/caldav/CalDavRequestHandlers.jsm:831] onStopRequest
6: [resource:///modules/caldav/CalDavRequest.jsm:554] get listener/get/<
CalStorageCalendar.jsm:2596

NS_ERROR_FILE_IS_LOCKED: Component returned failure code: 0x8052000e (NS_ERROR_FILE_IS_LOCKED) [mozIStorageStatement.executeStep] CalStorageCalendar.jsm:241
    executeSyncItemStatement resource:///modules/CalStorageCalendar.jsm:241
    setMetaData resource:///modules/CalStorageCalendar.jsm:2483
    saveCalendarProperties resource:///modules/CalDavCalendar.jsm:213
    onStopRequest resource:///modules/caldav/CalDavRequestHandlers.jsm:831
    get listener/get/< resource:///modules/caldav/CalDavRequest.jsm:554

so it is probably related to bug 1719096 and bug 1690872

The mSyncQueue is accumulating entries, which are never cleared:

mSyncQueue: (6) […]
​​​
0: function downstreamRefresh(status)​​​
1: function downstreamRefresh(status)​​​
2: function downstreamRefresh(status)​​​
3: function downstreamRefresh(status)​​​
4: function downstreamRefresh(status)​​​
5: function downstreamRefresh(status)

If I manually clear it with wrappedJSObject.mSyncQueue=[] from the debug console, the calendar will synchronize again.

I suspect the problem here is a race condition. I have quite a lot of calendars and the Nextcloud I'm synchronizing with is quite slow (running on Raspberry Pi). So a lot of requests are fired and return the results are coming back out of order.

I've been trying to reproduce that on Daily, but this has not occurred so far. So this might be already fixed.

(In reply to t.zell from comment #6)

I've been trying to reproduce that on Daily, but this has not occurred so far. So this might be already fixed.

Reporter, is it also gone for you?

Flags: needinfo?(alexandre.f.demers)
Summary: Reminder list is not refreshed properly when coming out of sleep is the reminder was already dismissed → Reminder list is not refreshed properly when coming out of sleep if the reminder was already dismissed
Whiteboard: [closeme 2022-05-05]

This problem has been there for ages, and it is still present in 91.10.0

Severity: normal → S3
Whiteboard: [closeme 2022-05-05]

(In reply to Andreas Pflug from comment #8)

This problem has been there for ages, and it is still present in 91.10.0

Also in version 102?

Flags: needinfo?(pgadmin)

Yes, I still see reminders popping up for long-gone-and-acknowledged events with 102.4.0 after waking up the other device. Both devices run the latest TB.
I see this problem on both devices: one Linux, one MacOS.

Flags: needinfo?(pgadmin)

Another annoying situation:

  • create reminder on machine 1
  • let machine 2 sync, hibernate
  • remove the reminder before it fired
  • wake up machine2 after the reminder would have fired. The reminder will pop up anyway, and won't go away easily: need to write back.

Alexandre seesm to be gone, so closing.

Andreas, if none of https://mzl.la/3XgHioZ describe your issue, please file a new bug report. Thanks.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Flags: needinfo?(alexandre.f.demers)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.