Bug 476642 - Wrong calculation in week recurrence after 15 iterations
Summary: Wrong calculation in week recurrence after 15 iterations
Status: REPORTED
Alias: None
Product: korganizer
Classification: Applications
Component: recurrence (show other bugs)
Version: 5.24.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-06 21:17 UTC by pietz
Modified: 2024-03-25 08:35 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Recurring event with wrong calculation (8th of Nov 2023 instead of 1st of Nov 2023) (565 bytes, text/calendar)
2023-11-06 21:17 UTC, pietz
Details
Screenshot from OpenSuse 15.5 (149.50 KB, image/png)
2023-11-25 12:43 UTC, Daniel Vrátil
Details
Newer version shows example event on wrong date (145.61 KB, image/png)
2023-11-25 22:52 UTC, pietz
Details
Creating the fresh event (72.37 KB, image/png)
2024-03-12 13:34 UTC, joris.scholl
Details
kOrganizer October View (58.92 KB, image/png)
2024-03-12 13:35 UTC, joris.scholl
Details
kOrganizer November View (53.69 KB, image/png)
2024-03-12 13:36 UTC, joris.scholl
Details
RegionAndLanguage (120.95 KB, image/png)
2024-03-13 21:01 UTC, joris.scholl
Details
DateAndTime (170.48 KB, image/png)
2024-03-13 21:01 UTC, joris.scholl
Details
Regional Settings in kOrganizer (101.28 KB, image/png)
2024-03-13 21:01 UTC, joris.scholl
Details
Small Calender view (42.97 KB, image/png)
2024-03-22 10:01 UTC, joris.scholl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pietz 2023-11-06 21:17:19 UTC
Created attachment 162915 [details]
Recurring event with wrong calculation (8th of Nov 2023 instead of 1st of Nov 2023)

I have an event that started on 2023-04-19 and I set a recurrence of 2 weeks with no end. It was very correct for 14 iterations but now it doesn't show me the event on 1st of November 2023 but on the 8th what is wrong if you calculate on your own. It just made 3 weeks out of the actual two and then continues with 2 weeks again.

I attached an example ics file where you can (hopefully) reproduce.

Thanks a lot for fixing!
Comment 1 Daniel Vrátil 2023-11-12 10:33:35 UTC
Hi, thanks for the report. I imported your event to KOrganizer but the recurrence seems OK to me - all the way until the end of 2023 the event appears on Wednesday every other week.

Any chance the event in your calendar has an recurrence exception that causes the few occurrences to be on another date?

Could you try to create another event and check whether you can reproduce it there as well?
Comment 2 pietz 2023-11-15 10:02:40 UTC
Yes, it does appear. that's not the bug.

But since November 2023 it appears on 8th of November. But that is wrong. It should appear on 1st of November 2023. Does it really appear on 1st of November this year on your machine? I tested it on two different installations and it always is shown on 8th of November.
Comment 3 Daniel Vrátil 2023-11-25 12:43:33 UTC
Created attachment 163459 [details]
Screenshot from OpenSuse 15.5

Yes, 1st of November and 15th of November 2023, no occurence inbetween. I tried on Debian 11, OpenSuse Leap 15, KDE Neon (current stable) and recent git master, it looks as expected on all of them (see that attached screenshot from my OpenSuse VM).

Does maybe the original event that you have in your calendar, have like a specific time, or a timezone? Maybe even different timezone than your system? What is your system timezone? Or is the original event an all-day event? What distro do you use? I can try to reproduce in a VM. Is the event stored in Google Calendar, CalDAV or local iCal file?

The only cases I can imagine that could suddenly break the recurrence for one incidence are
1) accidental recurrence exception - maybe you accidentally moved the one occurrence from 1st to 8th, which created a recurrence exception (you can check in event editor -> Recurrence tab)
2) daylight saving time start/end in your or event's timezone somehow interfering with the recurrence rule, causing this odd miscalculation

I can't think of anything else that could cause one calculation of the recurrence to suddenly go wrong on an arbitrary date and then resume correctly again.
Comment 4 pietz 2023-11-25 22:52:29 UTC
Created attachment 163481 [details]
Newer version shows example event on wrong date

Seems like my KOrganizer is newer than yours.

I use German time zone but should be unimportant. I just imported the event which I posted as first attachment.  Should be the same for a reproducing example for everyone.

It shows up on 8th of November as you can see in my screenshot. That is wrong, as it also differs to your screenshot. can anyone confirm with my version or upstream or in between?
Comment 5 giorgio.f 2023-11-28 15:09:56 UTC
(In reply to pietz from comment #4)
> Created attachment 163481 [details]
> Newer version shows example event on wrong date
> 
> Seems like my KOrganizer is newer than yours.
> 
> I use German time zone but should be unimportant. I just imported the event
> which I posted as first attachment.  Should be the same for a reproducing
> example for everyone.
> 
> It shows up on 8th of November as you can see in my screenshot. That is
> wrong, as it also differs to your screenshot. can anyone confirm with my
> version or upstream or in between?

Ciao, I am on the same Version 5.24.3 (23.08.3).
I imported your first attachment event.ics.
Here everything is fine, no mistakes.
Comment 6 pietz 2023-11-29 08:10:25 UTC
What means "fine"? Does the event display on 2023-11-01 or 2023-11-08?

I do nothing special or different to you. I just import the ics file from this bugs attachment. Why does it appear in my korganizer on the 8th of November which is wrong? So there must be some reason somehwere...
Comment 7 Daniel Vrátil 2023-12-06 15:56:59 UTC
From the screenshot it appears that there was public holiday on Nov 1st in your locale - could that be the reason for the event to be "postponed" by a week? Could you please try disabling holidays in KOrganizer Settings -> Date & Time -> Holidays? Make sure to restart KOrganizer afterwards, and also try to re-import the event, please.
Comment 8 Daniel Vrátil 2023-12-06 15:58:51 UTC
Also, have you imported it into a local calendar (like "Personal Calendar") or some remote calendar (e.g. Google Calendar or a CalDav calendar?)
Comment 9 Bug Janitor Service 2023-12-21 03:45:59 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 pietz 2023-12-21 08:06:57 UTC
I disabled the German holidays and restarted KOrganizer. I also removed the local calendar file and added events.ics as a local file resource again and it shows up at 8th of November.

Isn't that crazy? Any other ideas? It also appears on my KDE computer at work and at home. So two different installations with the same wrong 8th of November…

BTW: Should holidays trigger an offset/change to repetitions at all?
Comment 11 Bug Janitor Service 2024-01-05 03:46:11 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 12 joris.scholl 2024-03-12 13:34:51 UTC
Created attachment 167032 [details]
Creating the fresh event
Comment 13 joris.scholl 2024-03-12 13:35:48 UTC
Created attachment 167033 [details]
kOrganizer October View
Comment 14 joris.scholl 2024-03-12 13:36:32 UTC
Created attachment 167034 [details]
kOrganizer November View
Comment 15 joris.scholl 2024-03-12 13:38:36 UTC
Hi, I am experiencing similar bugs. I am creating a fresh Event on the 21.10.2023, with a recurrence of "Weekly every 2 weeks", as shown in the attachment "Creating the fresh event". When viewing the month overview of October, it is correctly shown on the 21.10 and the 04.11. When switching the view to November, it is NOT shown on the 04.11, but on the 11.11.  I attached screenshots of this.

I am using a synchronised calender via Nextcloud. In Nextcloud's webview, the same event is correctly shown on the 04.11 and starting from November, the same synchronised calender is shown correctly in the Nextcloud Webview and shifted by one week in the kOrganizer client.

Thus, it can not be related to the actual event but some recurrence bug in kOrganizer. I am also on a German system.

I want to highlight, that this is a very critical bug, making kOrganizer unusable for me.
Comment 16 Daniel Vrátil 2024-03-12 20:31:48 UTC
Joris, what version of KOrganizer do you have? Also, what exact locale (Germany, Austria, Switzerland, etc.) do you have configured? Would you mind sharing screenshot from System Settings -> Region & Language page (feel free to share it directly with me if you don't feel comfortable uploading it here), and what is your exact timezone settings (System Settings -> Date & Time -> Time Zone)?

I can't reproduce it with my current set up, and I suspect this might have something to do with locale/regional settings, so I need to re-configure my system the exact same way, so I can have some hope of reproducing the problem.
Comment 17 joris.scholl 2024-03-13 21:01:10 UTC
Created attachment 167122 [details]
RegionAndLanguage
Comment 18 joris.scholl 2024-03-13 21:01:30 UTC
Created attachment 167123 [details]
DateAndTime
Comment 19 joris.scholl 2024-03-13 21:01:52 UTC
Created attachment 167124 [details]
Regional Settings in kOrganizer
Comment 20 joris.scholl 2024-03-13 21:04:06 UTC
(In reply to Daniel Vrátil from comment #16)
> Joris, what version of KOrganizer do you have? Also, what exact locale
> (Germany, Austria, Switzerland, etc.) do you have configured? Would you mind
> sharing screenshot from System Settings -> Region & Language page (feel free
> to share it directly with me if you don't feel comfortable uploading it
> here), and what is your exact timezone settings (System Settings -> Date &
> Time -> Time Zone)?
> 
> I can't reproduce it with my current set up, and I suspect this might have
> something to do with locale/regional settings, so I need to re-configure my
> system the exact same way, so I can have some hope of reproducing the
> problem.

I attached the screenshots. Additionally executing 

env | grep -e '\(LC_\|LANG\)'

yields

LANGUAGE=en_GB
LC_ADDRESS=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LANG=en_GB.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8

Please note the mixed German and English settings. An interesting question would be, if pietz@gmx.de has similar locale settings.
Comment 21 Daniel Vrátil 2024-03-22 08:39:50 UTC
Thanks for all the data, unfortunately I wasn't able to reproduce the problem in any of three different VMs.

Could you please specify distro and exact KOrganizer version? Can you think of any other special settings you might have that could influence this?

Also, could you please check whether the bug is also present in e.g. Agenda view in week view (e.g. whether the event is shown correctly on week 44 or whether it's incorrectly shifted to week 45)?

Also, in the small calendar preview in the top-left corner, the dates on which an even occur should be highlighted in bold. Do  you see the correct boldened dates (i.e. 1.11. and 15.11. or is 8.11. boldened?)
Comment 22 Daniel Vrátil 2024-03-22 08:40:51 UTC
Oh and also version of Qt (at least the qtbase package (qt-base/qt5-base/qtbase-qt5... depends on the distro), please.
Comment 23 joris.scholl 2024-03-22 10:01:06 UTC
(In reply to Daniel Vrátil from comment #21)
> Thanks for all the data, unfortunately I wasn't able to reproduce the
> problem in any of three different VMs.
> 
> Could you please specify distro and exact KOrganizer version? Can you think
> of any other special settings you might have that could influence this?
> 
> Also, could you please check whether the bug is also present in e.g. Agenda
> view in week view (e.g. whether the event is shown correctly on week 44 or
> whether it's incorrectly shifted to week 45)?
> 
> Also, in the small calendar preview in the top-left corner, the dates on
> which an even occur should be highlighted in bold. Do  you see the correct
> boldened dates (i.e. 1.11. and 15.11. or is 8.11. boldened?)

No problem. I should thank you for providing me such a big help for free.

I have two machines. Please note I might have changed some locales from the last time. I executed

env | grep -e '\(LC_\|LANG\)' && korganizer --version && lsb_release -a && qmake --version

on both which returned:
Machine 1:

LANGUAGE=en_GB
LC_ADDRESS=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LANG=en_GB.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
korganizer 5.24.1 (23.08.1)
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:        23.10
Codename:       mantic
QMake version 3.1
Using Qt version 5.15.10 in /usr/lib/x86_64-linux-gnu

Machine 2:

LANGUAGE=en_GB
LC_MONETARY=de_DE.UTF-8
LANG=en_GB.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
korganizer 5.22.3 (22.12.3)
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux trixie/sid
Release:        11
Codename:       trixie
QMake version 3.1
Using Qt version 5.15.10 in /usr/lib/x86_64-linux-gnu

The regional settings in kOrganizer are identical. I honestly don't know of any other special settings that could cause this. Agenda view shows the same error. Week view too, although it might be interesting when iterating through the weeks starting from the week 16-22.10.2023 (in this week, the event that should recur every two weeks starts), the event is correctly shown in the week 16-22.10, then it is incorrectly shown in the week after that (23-29.10) then it alternates every 2 weeks, but on the weeks 18-24.03.2024 and 25-31.03.2024 it is again incorrectly absent for 2 weeks in a row.

So, I find it quiet interesting that Week View shows the event in the week 23-29.10 while month view does not show it there.

I attached the small calender view in the latest attachment. It shows the 04.11 bold correctly in October, but not bold in November
Comment 24 joris.scholl 2024-03-22 10:01:46 UTC
Created attachment 167596 [details]
Small Calender view
Comment 25 Daniel Vrátil 2024-03-25 08:35:24 UTC
Ha, this might be the key!

> but on the weeks 18-24.03.2024 and 25-31.03.2024 it is again incorrectly absent for 2 weeks in a row

Coincidentally, those dates are immediately around DST change dates in Europe:

DST end: October 29th, 2023 (affects next immediate recurrence, should be on November 4th, is on Nov 11th)
DST start: March 31st, 2024 (affects previous immediate recurrence, should be on March 23rd, is missing)

This massively narrows down the scope of code I need to dig through now :-) I'll see if I can spot the bug in the code or create some artificial testcase. Still curious what's could be the last bit of settings that I'm missing that makes the bug to manifest...