https://bugs.kde.org/show_bug.cgi?id=522388

            Bug ID: 522388
           Summary: kalendarac: option to not replay reminders for
                    past/already-ended events after suspend or reboot
                    (honor
                    RemindersAfterLogin/UseEventEndTimeForReminders)
    Classification: Frameworks and Libraries
           Product: Reminder Daemon
      Version First 6.7.1
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

After resume from suspend or after a reboot/relogin, kalendarac shows a flood
of
notifications for reminders that fired while the machine was off or asleep,
including reminders for events that are already over. There is no option to
suppress this, and the daemon has no notion of an event’s end time.

## Steps to reproduce

1. Have calendar events with reminders.
2. Suspend the machine (or power it off) across one or more reminder times.
3. Resume/boot and log in.

## Observed

Every reminder whose time fell into the offline window is shown at once,
including reminders for events whose end time is already in the past.

## Expected

An option to skip reminders for events that have already ended (end time in the
past) when catching up after downtime — and, more generally, an option to not
replay missed reminders at login/resume at all.

## Technical notes

In `reminder-daemon/kalendaralarmclient.cpp` the catch-up window is:

    mLastChecked = alarmGroup.readEntry("CalendarsLastChecked",
QDateTime::currentDateTime().addDays(-9));
    ...
    const QDateTime from = mLastChecked.addSecs(1);
    mLastChecked = QDateTime::currentDateTime();
    // mCalendar->alarms(from, mLastChecked, true) -> every alarm in [from,
now] is shown

So after downtime, `from` is the timestamp from before sleep/shutdown and the
whole missed interval is replayed. There is:

- no comparison of the incident’s end time against “now”, so reminders for
  already-ended events are shown;
- no handler for resume-from-suspend (timer-based polling only);
- no user-facing option to limit or disable the catch-up.

Interestingly, two config keys that look exactly designed for this still exist
in `~/.config/kalendarrc` (written by the old Kalendar/Merkuro app):

    [General]
    RemindersAfterLogin=false
    UseEventEndTimeForReminders=true

but the current akonadi-calendar reminder daemon does not read them (the
strings
are absent from the kalendarac binary). It would be ideal to revive these two
settings in the daemon:

- `RemindersAfterLogin` — if false, do not replay reminders missed while the
  daemon was not running/the session was away.
- `UseEventEndTimeForReminders` — when deciding whether a missed reminder is
  still relevant, compare against the event’s end time and skip events that
have
  already ended.

## Workaround currently used

A wrapper stamps `[Alarms]CalendarsLastChecked` to “now” before the daemon
starts (autostart override) and a systemd --user service watches logind’s
`PrepareForSleep` signal to do the same on resume and restart the daemon. This
suppresses the replay but cannot distinguish “event still upcoming” from “event
already ended”, which is exactly what `UseEventEndTimeForReminders` would
solve.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to