Bug 481305

Summary: Recurrence deletion for events created in another timezone does not work
Product: [Applications] korganizer Reporter: tusooa <tusooa>
Component: incidence editorsAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In: 24.02
Sentry Crash Report:

Description tusooa 2024-02-14 02:53:22 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
If a recurring event is created in another timezone, and the date on which the event falls in your local timezone is different from the date on which it falls in the creation timezone, deleting one recurrence will not work.

STEPS TO REPRODUCE
1. Set system timezone to America/Toronto
2. Create an event from 2023-06-18 2:00 AM **UTC** to 3:00 AM **UTC**.
3. Set the recurrence to "Repeat weekly, every 1 week" on: Sunday, ends: never
4. In the Agenda view, delete the instance on 2024-02-17 (this is a Saturday, but the corresponding UTC time falls on a Sunday). In the popup dialog, click "Delete Current."

OBSERVED RESULT
The recurrence is not deleted. If you Edit the event again, you can see that 2024-02-17 is set as an exception.

EXPECTED RESULT
The recurrence should be deleted. If you Edit the event again, you should see that 2024-02-18 (not 17) is set as an exception.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 6.6.13-gentoo-x86_64 / 5.27.10
(available in About System)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.114.0
Qt Version: 5.15.12

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2024-02-19 11:00:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/korganizer/-/merge_requests/117
Comment 2 Daniel Vrátil 2024-02-19 13:00:35 UTC
Git commit 8121e4aedb67660dbea3654a569121cd9e463422 by Daniel Vrátil.
Committed on 19/02/2024 at 10:59.
Pushed by dvratil into branch 'release/24.02'.

Use correct timezone when creating recurrence exception

When an incidence occurs on a different day in its original timezone
than in the user's local timezone, deleting a recurrence gives us
a date in the user's local timezone. However, in order for the
recurrence exception to work, the exception date must fall on a date
in the incidence's original timezone.

This change makes sure that the recurrence exception is correctly
converted from local time to the incidence's original timezone before
storing it.

This commit only covers deleting a recurrence ocurrence from KOrganizer
event view. Additional similar patch for the Incidence Editor is needed
to show/create exceptions correctly there.
FIXED-IN: 24.02

M  +5    -3    src/calendarview.cpp

https://invent.kde.org/pim/korganizer/-/commit/8121e4aedb67660dbea3654a569121cd9e463422
Comment 3 Daniel Vrátil 2024-02-21 07:59:42 UTC
Git commit cedb100cb3158d0071358e4c1cc73bbda35412e0 by Daniel Vrátil.
Committed on 21/02/2024 at 07:44.
Pushed by dvratil into branch 'master'.

Correctly handle timezone of recurrence exceptions

An incidence can occur on a different day in its original timezone
than in the user's local timezone. The incidence editor's exception
recurrence editor should always show the exception dates in the
user's local timezone.

M  +9    -5    src/incidencerecurrence.cpp

https://invent.kde.org/pim/incidenceeditor/-/commit/cedb100cb3158d0071358e4c1cc73bbda35412e0