Bug 284224 - maildir resource does not become AgentBase::Broken when started without a valid maildir path
Summary: maildir resource does not become AgentBase::Broken when started without a val...
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Maildir Resource (show other bugs)
Version: 4.8
Platform: Compiled Sources Linux
: NOR major
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-16 22:02 UTC by Will Stephenson
Modified: 2012-03-17 16:49 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Will Stephenson 2011-10-16 22:02:54 UTC
Since 4.6.0 we've been seeing maildir resources with broken configs.  When these are migrated to 4.7, kmail2 refuses to start with "Failed to fetch the resource collection" because the SpecialCollections provided by local maildir resources are not present.  

On viewing the resource in akonadiconsole from 4.6.0 to current master, the resource state is still Ready - this should be Broken.
Comment 1 Will Stephenson 2011-10-16 22:42:40 UTC
If MaildirResource::ensureSaneConfiguration() is called in the ctor, we notice the problem early.  This would allow kmail-migrator to correct the problem or warn the user.

diff --git a/resources/maildir/maildirresource.cpp b/resources/maildir/maildirresource.cpp
index 7536aa8..89ff635 100644
--- a/resources/maildir/maildirresource.cpp
+++ b/resources/maildir/maildirresource.cpp
@@ -112,6 +112,7 @@ MaildirResource::MaildirResource( const QString &id )
   scope.setAncestorRetrieval( ItemFetchScope::None );
   setItemSynchronizationFetchScope( scope );
 
+  ensureSaneConfiguration();
   connect( m_fsWatcher, SIGNAL(dirty(QString)), SLOT(slotDirChanged(QString)) );
 
   synchronizeCollectionTree();
l
Comment 2 András Manţia 2012-02-11 11:37:12 UTC
Git commit e62bc48f1bfeb212337474b2cc6ea8689af383a4 by Andras Mantia.
Committed on 11/02/2012 at 12:36.
Pushed by amantia into branch 'master'.

Check configuration at startup.
Patch from Will.
FIXED-IN: 4.8.1

M  +2    -0    resources/maildir/maildirresource.cpp

http://commits.kde.org/kdepim-runtime/e62bc48f1bfeb212337474b2cc6ea8689af383a4
Comment 3 András Manţia 2012-02-11 11:38:43 UTC
Git commit 35aa0172063541d72993cd30df630de6d2fb664a by Andras Mantia.
Committed on 11/02/2012 at 12:36.
Pushed by amantia into branch 'KDE/4.8'.

Check configuration at startup.
Patch from Will.
FIXED-IN: 4.8.1
(cherry picked from commit e62bc48f1bfeb212337474b2cc6ea8689af383a4)

M  +2    -0    resources/maildir/maildirresource.cpp

http://commits.kde.org/kdepim-runtime/35aa0172063541d72993cd30df630de6d2fb664a
Comment 4 András Manţia 2012-02-11 12:13:07 UTC
Git commit d4f0f74a5139325c7a78bbd07c8c91f6d9f02f29 by Andras Mantia.
Committed on 11/02/2012 at 13:12.
Pushed by amantia into branch 'master'.

Improvement of the previous commit, so a newly created resource doesn't remain in Broken state.

M  +10   -4    resources/maildir/maildirresource.cpp
M  +1    -1    resources/maildir/maildirresource.h

http://commits.kde.org/kdepim-runtime/d4f0f74a5139325c7a78bbd07c8c91f6d9f02f29
Comment 5 András Manţia 2012-02-11 12:13:47 UTC
Git commit 66587d91216dd8b24edc58fe350a3be76dc3adda by Andras Mantia.
Committed on 11/02/2012 at 13:12.
Pushed by amantia into branch 'KDE/4.8'.

Improvement of the previous commit, so a newly created resource doesn't remain in Broken state.
(cherry picked from commit d4f0f74a5139325c7a78bbd07c8c91f6d9f02f29)

M  +10   -4    resources/maildir/maildirresource.cpp
M  +1    -1    resources/maildir/maildirresource.h

http://commits.kde.org/kdepim-runtime/66587d91216dd8b24edc58fe350a3be76dc3adda
Comment 6 Ed Tomlinson 2012-03-17 16:49:27 UTC
Think this bug is not 100% fixed in 4.8.1.  You can generate it by trying to add a new maildir.  Kmail will post a message that the resource is broken.  If you type in a full mairdir path, for a new maildir directory, it will let you proceed.