Bug 357236

Summary: Kontact 15.12.0: Categories are multiplied on using them for tasks or events
Product: [Applications] kontact Reporter: Till Schäfer <till2.schaefer>
Component: calendarAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: auxsvr, bberberov+kde
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 16.08.1
Sentry Crash Report:
Attachments: duplicate categoeries

Description Till Schäfer 2015-12-27 23:06:12 UTC
Whenever i select a category (i.e. annotation) of a task or an event, the category i doubled. I.e. the same category shows up multiple times. This even happens, when opening a task tagged with a category and choosing cancel afterwards. 

The bug occurred first with 15.08 and is still present in 15.12.0 

see attached screenshot for an example. 

Reproducible: Always
Comment 1 Till Schäfer 2015-12-27 23:10:40 UTC
Created attachment 96321 [details]
duplicate categoeries
Comment 2 Boian Berberov 2016-02-06 18:30:58 UTC
I can confirm this behavior occurs exactly as described in openSUSE Tumbleweed, Kontact version 15.12.1-1.1
Comment 3 Boian Berberov 2016-02-06 20:00:08 UTC
This bug is a duplicate of bug 352645 and should probably block it.  Bug 352645 should become a tracker for the multiple issues with categories in Kontact.
Comment 4 Daniel Vrátil 2016-08-26 13:27:18 UTC
Git commit c32d82e481568e41d11e5426005b6c9634f2e9b8 by Daniel Vrátil, on behalf of Denis Kurz.
Committed on 26/08/2016 at 13:26.
Pushed by dvratil into branch 'Applications/16.08'.

Set initial categories for non-cached incidences correctly

The old implementation tried to match loaded and existing tags on the
akonadi server side. A new CreateTag job was sent to the server, with
the name of the new tag and the hint to first check if this tag already
exists. The server, however, does not know about any tag names, and
tried to match the new tag by global id, which is completely random in
the TagCreate job.

Now, the matching is done on the client side, where the concept of tag
names is located. We fetch all tags from the server and check if the
categories of the loaded category match the names of these tags. For
every category that was not found in the tag list returned from the
server, we send a TagCreate job.

As a side benefit, we now also keep track of tags that failed to be
created on the server. We now report all tags that were selected,
as well as all categories that were set when the editor was opened
and for which no corresponding tag could be created. This reduces
the risk of losing categories.

Test Plan:
Opening the incidenceeditor from korganizer's eventviews for variuos
cached and non-cached items did not produce a single tag duplicate.
Also, the TagWidget's content is set correctly after the incidenceeditor
is created. Without the patch, everything reported in Bug 352645
happened here, too.
Related: bug 352645
FIXED-IN: 16.08.1

Differential Revision: https://phabricator.kde.org/D2423

M  +63   -11   src/incidencecategories.cpp
M  +16   -9    src/incidencecategories.h

http://commits.kde.org/incidenceeditor/c32d82e481568e41d11e5426005b6c9634f2e9b8
Comment 5 Till Schäfer 2016-09-14 13:22:06 UTC
*** Bug 355426 has been marked as a duplicate of this bug. ***