Bug 122643 - Association of a task with multiple desktops doesn't survive restart
Summary: Association of a task with multiple desktops doesn't survive restart
Status: RESOLVED FIXED
Alias: None
Product: ktimetracker
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Mark Bucciarelli
URL:
Keywords:
: 143568 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-02-24 14:35 UTC by Isaac Wilcox
Modified: 2007-03-29 10:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
fix (839 bytes, patch)
2006-02-25 19:07 UTC, Thorsten Staerk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Isaac Wilcox 2006-02-24 14:35:08 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Debian testing/unstable Packages

Hi,

Steps to reproduce:
 - Start with an empty Karm, and a 4-desktop layout in KDE
 - Create two tasks, A and B
 - Turn on "auto-tracking" for both, associating A with desktops 1 and 3, and B with desktops 2 and 4
 - Test that those associations work by spending a minute on each desktop
 - Quit KArm, and start it up again
 - Edit each task, and look at the desktop associations.

When I check the associations after the restart, I see task A associated with only desktop 3, and task B associated with only desktop 4.

Cheers,

Zak (Isaac Wilcox)
Comment 1 Thorsten Staerk 2006-02-24 18:40:24 UTC
Thanks for your detailed report.
I did exactly as you describe and cannot reproduce.
You describe the procedure to reproduce very thoroughly. Am I correct that you had to try several times ? Maybe this is an issue that occurs from time to time, pseudo-randomly. If yes, please state this. If no (so, 100% reproducible): 
- are you using a local file ?
- do kdelibs, kdebase and kdepim have the same version ?
- did you install "per default", with apt-get or did you do some tricks ?
Comment 2 Thorsten Staerk 2006-02-24 18:45:31 UTC
cat /tmp/karm.ics | grep X-KDE-karm-desktopList:
Comment 3 Isaac Wilcox 2006-02-24 19:13:27 UTC
I installed karm today, simply using "apt-get -t unstable install karm".  Those three packages are all at KDE 3.5.1.  Specifically:
 kdebase: 4:3.5.1-1
 kdelibs: 4:3.5.1-2
 karm:    4:3.5.1-1

It's 100% reproducible.

My karm.ics is a local file.  The grep yields different things depending on when it gets run.  If I set A = 1 and 3, B = 2 and 4, and quit, and run:
 grep 'desktopList\|SUMMARY' /home/zak/.kde/share/apps/karm/karm.ics | head -4
then I get:
 X-KDE-karm-desktopList:1,3
 SUMMARY:A
 X-KDE-karm-desktopList:0,2
 SUMMARY:B

If I then start karm up again *but change nothing at all* and re-run the grep, then I get:
 X-KDE-karm-desktopList:3
 SUMMARY:A
 X-KDE-karm-desktopList:2
 SUMMARY:B
Comment 4 Isaac Wilcox 2006-02-24 19:58:03 UTC
My reproduction steps were just long because I was being lazy and couldn't be bothered to narrow the bug down :)  I can also reproduce it with:

- create a task A that's active on desktops 2,3,4
- quit karm
- start karm
- edit task A and see it's now active only on desktop 4

So whatever bit of code is at fault here is dropping all but the last desktop, and doing it at startup.
Comment 5 Thorsten Staerk 2006-02-24 20:58:22 UTC
I want to narrow down the root cause. For that, please create an additional user and see if the problem persists for this user. If yes, it is a configuration issue. I do not want you to use another user forever, just give it a try.
Comment 6 Thorsten Staerk 2006-02-24 21:12:20 UTC
On another computer, I can reproduce the second test case.
Setting this bug to confirmed (new).
Comment 7 Thorsten Staerk 2006-02-24 21:16:01 UTC
bug occurs with Revision: 502526
Comment 8 Isaac Wilcox 2006-02-24 21:17:35 UTC
Looks like you're getting closer, but FWIW, I get exactly the same problem using a completely new user.
Comment 9 Thorsten Staerk 2006-02-24 23:36:13 UTC
A libkcal bug!!!

see libkcal/icalformatimpl.cpp, function readCustomProperties. For every desktopentry, it overrides the previous one:

scorpio:~/svn/3.5/kdepim/karm # grep "X-KDE-karm-desktopList" ../bug3.ics
X-KDE-karm-desktopList:1,2,3
scorpio:~/svn/3.5/kdepim/karm # karm
kparts: MainWindow::createGUI, part=(nil)
karm: KarmStorage::remoteResource(  ) returns false
karm: KarmStorage::remoteResource( /root/svn/3.5/kdepim/bug3.ics ) returns false
kio (KDirWatch): Can't use FAM (fam daemon not running?)
kio (KDirWatch): Can't use INotify, Linux kernel too old
kio (KDirWatch): Available methods: Stat
kio (KDirWatch): Added File /root/svn/3.5/kdepim/bug3.ics [KDirWatch-1]
kio (KDirWatch): Global Poll Freq is now 500 msec
kio (KDirWatch):  Started Polling Timer, freq 500
kio (KDirWatch):  Setup Stat (freq 500) for /root/svn/3.5/kdepim/bug3.ics
libkdepim: timezone from korganizerrc is [No selection]
kresources: Opening resource KArm
libkcal: Opening resource KArm
libkcal: Loading resource KArm
libkcal: ICalFormat::load() /root/svn/3.5/kdepim/bug3.ics
libkcal: Set custom property [X-KDE-karm-desktopList=1]
libkcal: Set custom property [X-KDE-karm-desktopList=2]
libkcal: Set custom property [X-KDE-karm-desktopList=3]

first the value for X-KDE-karm-desktopList is 1, this is overwritten with 2, then 3.
Comment 10 Isaac Wilcox 2006-02-25 16:15:13 UTC
So, does one of us raise a new bug against libkcal for this, or does this bug get reassigned to libkcal, or what?  I can do the former if necessary but don't have the privileges to do the latter.
Comment 11 Thorsten Staerk 2006-02-25 18:18:42 UTC
This bug has most probably been introduced with libical 0.24. The desktop list is a "custom property" of the ical-file. It is filled with "1,2,3" for the second test case. The old libical then delivered "1,2,3". The new libical delivers "1", then delivers "2", then "3". Thus, libkcal is overriding the "1" first with "2", then with "3", so, only the 3 stays.
First step could be that karm uses a ; as delimiter instead of a ,.

I can fix libkcal bugs, no need for a reassignment.
Comment 12 Thorsten Staerk 2006-02-25 19:07:03 UTC
Created attachment 14871 [details]
fix

This fixes the problem by replacing the "1,2,3" by "1-2-3". You will not be
able to use your old .ics file without modifications. Apparently no one noticed
the possibility to store several virtual desktops went away, but nevertheless,
I do not want to break the compatibility between ics files.
This fix is just for you, Isaac. I will try to get libkcal right for KDE 4.
Comment 13 Isaac Wilcox 2006-02-25 20:01:31 UTC
Thanks very much for the patch, much appreciated.  I'll build a new karm now and give it a go.

I've raised bug 122708 against libkcal (while I've no doubt you can fix libkcal bugs yourself, it just seems like the Right Thing To Do[TM] to have a suitably titled bug in the right place in the BTS).  Guess this bug should be marked as blocked on that one, if that's possible.
Comment 14 Thorsten Staerk 2006-03-04 12:49:48 UTC
This bug is fixed with the following commit:
http://websvn.kde.org/trunk/KDE/kdepim/libkcal/tests/cal?rev=515421&view=rev

I want to close this bug report as soon as this solution is available for KDE 3.5, not only for KDE 4.
Comment 15 Thorsten Staerk 2006-03-04 19:53:30 UTC
Fixed for KDE 4, won't fix for KDE 3.5. 
KDE 3.5 is stable, the changes I have to do to fix this could damage more than their use would be.
Feel free to use the patch from comment 12 and re-do your desktoplist after a KDE upgrade.
Comment 16 Thorsten Staerk 2007-03-29 10:17:43 UTC
*** Bug 143568 has been marked as a duplicate of this bug. ***