1 |
dilfridge 13/10/30 16:55:22 |
2 |
|
3 |
Added: kdepimlibs-4.11.2-sentuuid.patch |
4 |
Log: |
5 |
Backport fix for kde bug 323762 |
6 |
|
7 |
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 94BFDF4484AD142F) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 kde-base/kdepimlibs/files/kdepimlibs-4.11.2-sentuuid.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/kdepimlibs/files/kdepimlibs-4.11.2-sentuuid.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/kde-base/kdepimlibs/files/kdepimlibs-4.11.2-sentuuid.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: kdepimlibs-4.11.2-sentuuid.patch |
16 |
=================================================================== |
17 |
From 498d6678f478bd1bd9bdc944bb790f6b16b7ade4 Mon Sep 17 00:00:00 2001 |
18 |
From: =?UTF-8?q?Dan=20Vr=C3=A1til?= <dvratil@××××××.com> |
19 |
Date: Wed, 30 Oct 2013 16:46:45 +0100 |
20 |
Subject: [PATCH] Wait for changes from resource to be written to Akonadi |
21 |
before marking change as processed |
22 |
|
23 |
This fixes a problem with invalid RIDs after inter-resource moves. |
24 |
When there is an another changeReplay for the just moved item |
25 |
scheduled in the new parent resource, the item will have invalid RID |
26 |
(or rather RID assigned to it by the previous parent resource). |
27 |
It's because the ItemModifyJob dispatched from ResourceBase::changesCommitted() |
28 |
with the new RID is not finished yet when the next task is dispatched, |
29 |
and so the item in resource's EntityCache is not invalidated |
30 |
and the resource will use it instead of the updated one. |
31 |
|
32 |
By waiting for the ItemModifyJob dispatched from changesCommited() |
33 |
to finish before marking the change as processed and dispatching |
34 |
next task we make sure that in case the next task involves the |
35 |
same item the change will be stored in Akonadi and the item will |
36 |
be invalidated in local caches, forcing the resource to fetch the |
37 |
item again from Akonadi before starting the task. |
38 |
|
39 |
This fixes 'Invalid uidset' error reported by IMAP resources after |
40 |
the MailDispatcher agent moves the mail from local Outbox to remote |
41 |
Sent folder and updates it's flags. |
42 |
|
43 |
BUG: 323762 |
44 |
BUG: 324807 |
45 |
CCBUG: 314964 |
46 |
FIXED-IN: 4.11.3 |
47 |
--- |
48 |
akonadi/resourcebase.cpp | 16 +++++++++++----- |
49 |
1 file changed, 11 insertions(+), 5 deletions(-) |
50 |
|
51 |
diff --git a/akonadi/resourcebase.cpp b/akonadi/resourcebase.cpp |
52 |
index 70c8286..2383ba0 100644 |
53 |
--- a/akonadi/resourcebase.cpp |
54 |
+++ b/akonadi/resourcebase.cpp |
55 |
@@ -670,12 +670,11 @@ void ResourceBase::changeCommitted( const Item& item ) |
56 |
|
57 |
void ResourceBase::changesCommitted(const Item::List& items) |
58 |
{ |
59 |
- Q_D( ResourceBase ); |
60 |
ItemModifyJob *job = new ItemModifyJob( items ); |
61 |
job->d_func()->setClean(); |
62 |
job->disableRevisionCheck(); // TODO: remove, but where/how do we handle the error? |
63 |
job->setIgnorePayload( true ); // we only want to reset the dirty flag and update the remote id |
64 |
- d->changeProcessed(); |
65 |
+ connect( job, SIGNAL(finished(KJob*)), this, SLOT(changeCommittedResult(KJob*)) ); |
66 |
} |
67 |
|
68 |
void ResourceBase::changeCommitted( const Collection &collection ) |
69 |
@@ -687,9 +686,16 @@ void ResourceBase::changeCommitted( const Collection &collection ) |
70 |
void ResourceBasePrivate::changeCommittedResult( KJob *job ) |
71 |
{ |
72 |
Q_Q( ResourceBase ); |
73 |
- if ( job->error() ) |
74 |
- emit q->error( i18nc( "@info", "Updating local collection failed: %1.", job->errorText() ) ); |
75 |
- mChangeRecorder->d_ptr->invalidateCache( static_cast<CollectionModifyJob*>( job )->collection() ); |
76 |
+ if ( qobject_cast<CollectionModifyJob*>( job ) ) { |
77 |
+ if ( job->error() ) { |
78 |
+ emit q->error( i18nc( "@info", "Updating local collection failed: %1.", job->errorText() ) ); |
79 |
+ } |
80 |
+ mChangeRecorder->d_ptr->invalidateCache( static_cast<CollectionModifyJob*>( job )->collection() ); |
81 |
+ } else { |
82 |
+ // TODO: Error handling for item changes? |
83 |
+ // Item cache is invalidated by ItemModifyJob |
84 |
+ } |
85 |
+ |
86 |
changeProcessed(); |
87 |
} |
88 |
|
89 |
-- |
90 |
1.8.3.2 |