Summary: | KPilot vcal conduit changes day when syncing repeating events | ||
---|---|---|---|
Product: | [Applications] kpilot | Reporter: | Dan Mareck <wb2kiu> |
Component: | Calendar Conduit | Assignee: | Douglas Harms <dharms> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | dharms, topeju, vR |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Proposed patch to fix recurrence problems with monthly-by-day-and-week |
Description
Dan Mareck
2003-07-03 15:01:46 UTC
Subject: Re: New: KPilot vcal conduit changes day when syncing repeating events
On Thursday 03 July 2003 15:01, you wrote:
> When a repeating event is created in KOrganizer, then sync'd with the Palm,
> the event on the palm is moved ahead by one day.
This is a duplicate, though I can't think of of what right now. We had this
problem a long time back and as far as I know Reinhold fixed it.
When I searched the Bug database before posting this potential bug, I found 21816 which was the same and 24291 which was similar. Both of these were reported fixed and closed in 2001. I found this problem in KPilot 4.3.10(BRANCH), pilot-link 0.11.7., which are part of KDE 3.1.1 (or 2?) Yes, you are the second one to report this behavior in a recent version. That's the reason I didn't close it (didn't comment on it either, though. I still have to investigate this). I haven't tested anything, but your bug report fortunately gives good examples to check it. I can confirm this: A repeating appointment at the 2. sunday every month starting on 13.7.2003 was moved to start on 14.9.2003. And another occurence: A repeating appointment at the 4. sunday every month was moved toanother day. An phantom duplicate was inserted with enabled alarm.My configuration is slightly different:Linux kernel 2.4.16 on Debian WoodyKDE 3.1.2Qt 3.1.2pilot-link 0.11.7KPilot 4.3.10 (BRANCH)Palm device: Sony Clie PEG SJ22/EPalm Desktop 4.1Konduits.KDE address book: pilot has preference over PC, full syncKOrgangizer: Only Pilot to PC, sync archive, pilot has preference over PC Subject: kdepim/kpilot/conduits/vcalconduit CVS commit by kainhofe: Fixed bug #60691 where events recurring monthly on a given weekday were shifted by one day. Also, when initializing a LocalCalendar, you are not supposed to give a time zone... Also, fixed infinite loop glitch by Cornelius. CCMAIL: 60691-done@bugs.kde.org M +4 -2 todo-conduit.cc 1.38 M +39 -13 vcal-conduit.cc 1.95 M +3 -2 vcal-conduitbase.cc 1.45 I'm still having problems related to this bug. in particular, with Pilot-link 0.11.8-r1 and kpilot in KDE 3.5.1 (Gentoo distribution), I get the following behavior: 1. Create an event in Korganizer: Tues 2/7 at 6:45pm-10pm. Repeating first Tuesday of the month until 6/7/2006. 2. Sync 3. Event on handheld shows as occuring on the first Weds of every month. By the way, I'm using a Treo 650. In response to Jason's observations. This did not happen at all in KDE 3.4.3. I just got around to upgrading to 3.5.2 and I saw this happen one time on a fresh install of KDE 3.5.2. After that one instance, I have not been able to reproduce it. I am having this problem in KDE 3.5.2. I also get this behaviour. It started with KDE 3.5 and is not yet fixed in 3.5.4 (kpilot 4.6.0). The problem is the same on i386 and alpha machines, by the way. I suspect that the recurring event date shift may be related to timezone & clock configuration - although I haven't taken the time to fully explore that theory. I saw this shift one time after I upgraded to KDE 3.5.2. My hardware clock was set to local time and Korganizer had an Eastern Timezone set. From what I remember, the shift disappeared when I set Korganizer to "No Selection" for timezone. I hope this observation helps. Created attachment 24419 [details]
Proposed patch to fix recurrence problems with monthly-by-day-and-week
I've looked into this a bit and I think I have the problem solved. I added some
instrumentation to the two setRecurrence functions in vcalconduit.cc (I'm using
korganizer from Ubuntu 7.10, i.e. version 3.5.7, and kpilot from the 3.5 branch
in Subversion, checked out on 2008-04-10), and got the results below.
First, I nuked my calendar contents in KOrganizer (and got a backup of my palm
using pilot-link). I have an event recurring monthly, on the third Wednesday of
each month. The event gets properly synchronized from the Palm to the Kontact
calendar.
However, later on, when the event gets synced back to the Palm, I noted that
the KCal::RecurrenceRule::WDayPos mp (in static void
setRecurrence(PilotDateEntry*dateEntry, const KCal::Event *event)) has:
mp.pos()=3, mp.day()=3. According to recurrencerule.h in libkcal,
WDayPos::day() returns 1 for Monday and 7 for Sunday, and this - I think - is
where the error in vcalRecord.cc is: these are not bit numbers here but day
numbers, and thus the results are already off by one (an annoying inconsistency
in libkcal if you ask me). So we only need to convert 7 to 0 for Sundays, but
we shouldn't add 1 to it before the modulo.
I've attached a proposed patch (svn diff), which seems to work for me at least,
and should be ok if the documentation is ok. :-)
I'm experiencing the same problem - recurrence problems with monthly-by-day issues. Tomi's patch works for me. Has anyone committed this patch yet? --Doug Huh. I'm not really sure what's been going on with this bug. My guess is that since it's closed and not assigned to any current KPilot authors, it's not shown up in my radar. Yuckie! Okay, Doug, I'll reopen and assign to you. =:) Thanks for bringing this one to my attention! Proposed patch posted for review at: http://reviewboard.kde.org/r/26/ Please take a look and let me know if this works for you too. Obviously, the patch works for me (both ways), though I'd also test the opposite direction, i.e. adding events on the Palm, and syncing them to korganizer. Also, sync a couple times to see events don't start shifting. I posted a revised patch to http://reviewboard.kde.org/r/26/ for review. I added a bit more handling of recurrences that are defined in korganizer as "from end of month" (e.g., second-from-last thursday each month). The palm doesn't support this (except for the last day of a month). The code here does the following mapping: kcal 2nd from last => palm 3rd kcal 3rd from last => palm 2nd kcal 4th from last => palm 1st kcal 5th from last => palm 1st The recurrences will be correct during months with 4 occurrence so the day; it will be one week early during months with 5 occurrences of the day. What does everyone think - is this OK? I'd like to commit this sometime soon. Thanks!! --Doug That definitely sounds good to me, Doug, especially if you've tested it and made sure it works. =:) At some point in the future, we should be adding these cases to the test cases that we have, but I'm more than willing to get these fixes in and worry about that later. =:) Thanks!! SVN commit 924058 by dharms: Fixes a problem in kpilot where events that recur on a specific weekday each month (e.g., 3rd Thursday) were not synced properly. This also fixes a problem where recurring events specified as a weekday from the end of the month (e.g., 2nd to the last Wednesday) are handled in a reasonable (though not entirely correct) fashion. (The palm cannot handle events specified like this, so this patch attempts to convert the "from end of month" recurring event to a "from the beginning of month" event.) BUG:60691 M +40 -5 calendarconduit.cc WebSVN link: http://websvn.kde.org/?view=rev&revision=924058 |