Bug 262423 - Akonadi shows too many "Could not authenticate" dialogs
Summary: Akonadi shows too many "Could not authenticate" dialogs
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Unclassified
Component: POP3 Resource (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Thomas McGuire
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-07 16:08 UTC by Igor Poboiko
Modified: 2011-01-09 19:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Draw attention to taskbar - all these windows are these dialog (623.36 KB, image/png)
2011-01-07 16:08 UTC, Igor Poboiko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Poboiko 2011-01-07 16:08:33 UTC
Created attachment 55694 [details]
Draw attention to taskbar - all these windows are these dialog

Version:           unspecified (using Devel) 
OS:                Linux

I have disabled internet on my laptop.
First of all, akonadi thinks that "Socket operation timed out" means that "server refused supplied username and password". It's totally wrong, because my username and password are ok.
Secondly, akonadi shows such a dialog every 5 minutes (or time period like that). My laptop was running KDE without internet for one night and after that I saw near to 100 "Could not authenticate" dialogs. That is really bad.
Thirdly, there is no way to disable this dialog. If user press "Cancel", the dialog will anyway appear after 5 minutes. There should be something like checkbox "Don't show this message again".

IMAP resource has the same problems.

Reproducible: Always

Steps to Reproduce:
1. Configure Akonadi POP3/IMAP resource using right account.
2. Disable internet.
3. Wait some time.

Actual Results:  
Akonadi shows a "Could not authenticate dialog" with the reason "The server refused the supplied username and password", and does it every 5 minutes.

Expected Results:  
Akonadi should show nothing (or a little notification with "Connection problems" message)

I use Akonadi 1.4.90 with KDE SC 4.5.95 (aka RC2). Akonadi IMAP resource configured for GMail.com account and Akonadi POP3 resource configured for Mail.Ru account.
And see attached screenshot.
Comment 1 Thomas McGuire 2011-01-09 18:27:12 UTC
> First of all, akonadi thinks that "Socket operation timed out" means that
> "server refused supplied username and password". It's totally wrong, because > my username and password are ok.

Yes, I know, we need to change that text, didn't so far because of the string freeze.

> Secondly, akonadi shows such a dialog every 5 minutes (or time period like
> that). My laptop was running KDE without internet for one night and after that
> I saw near to 100 "Could not authenticate" dialogs. That is really bad.

This has been fixed in the meantime, now at most 1 dialog will be shown.
Comment 2 Thomas McGuire 2011-01-09 19:12:17 UTC
commit ee978a27e32006f8e184270fc6ea857ad5ed4b02
branch master
Author: Thomas McGuire <mcguire@kde.org>
Date:   Sun Jan 9 17:47:40 2011 +0000

    Remove the error dialog entirely.
    
    Several reasons:
    1) the text in it is factually incorrect
    2) dialogs that pop up are annoying
    3) kmail/akonaditray should be responsible for showing an error popup anyway
    
    BUG: 262423

diff --git a/resources/pop3/pop3resource.cpp b/resources/pop3/pop3resource.cpp
index 85c6f8f..9a84202 100644
--- a/resources/pop3/pop3resource.cpp
+++ b/resources/pop3/pop3resource.cpp
@@ -47,8 +47,7 @@ POP3Resource::POP3Resource( const QString &id )
       mAskAgain( false ),
       mIntervalTimer( new QTimer( this ) ),
       mTestLocalInbox( false ),
-      mWallet( 0 ),
-      mErrorDialogShown( false )
+      mWallet( 0 )
 {
   setNeedsNetwork( true );
   Settings::self()->setResourceId( identifier() );
@@ -85,7 +84,7 @@ void POP3Resource::updateIntervalTimer()
 void POP3Resource::intervalCheckTriggered()
 {
   Q_ASSERT( mState == Idle );
-  if ( isOnline() && !mErrorDialogShown ) {
+  if ( isOnline() ) {
     kDebug() << "Starting interval mail check.";
     startMailCheck();
     mIntervalCheckInProgress = true;
@@ -520,22 +519,6 @@ void POP3Resource::loginJobResult( KJob *job )
       mAskAgain = true;
     cancelSync( i18n( "Unable to login to the server %1.", Settings::self()->host() ) +
                 '\n' + job->errorString() );
-
-    // FIXME: "The server refused the supplied username and password." is not correct! The server might
-    //        not even be online, there might be a connection problem etc
-    mErrorDialogShown = true;
-    int i = KMessageBox::questionYesNoCancelWId( winIdForDialogs(),
-                                  i18n( "The server refused the supplied username and password. "
-                                        "Do you want to go to the settings, have another attempt "
-                                        "at logging in, or do nothing?\n\n"
-                                        "%1", job->errorString() ),
-                                  i18n( "Could Not Authenticate" ),
-                                  KGuiItem( i18n( "Account Settings" ) ),
-                                  KGuiItem( i18nc( "Input username/password manually and not store them", "Try Again" ) ) );
-    mErrorDialogShown = false;
-    if ( i == KMessageBox::Yes ) {
-      configure( winIdForDialogs() );
-      return;
     }
   }
   else {
@@ -998,7 +981,7 @@ void POP3Resource::startMailCheck()
 
 void POP3Resource::retrieveCollections()
 {
-  if ( mState == Idle && !mErrorDialogShown ) {
+  if ( mState == Idle ) {
     startMailCheck();
   }
   else {
diff --git a/resources/pop3/pop3resource.h b/resources/pop3/pop3resource.h
index b594a28..14aba20 100644
--- a/resources/pop3/pop3resource.h
+++ b/resources/pop3/pop3resource.h
@@ -143,7 +143,6 @@ class POP3Resource : public Akonadi::ResourceBase,
     bool mSavePassword;
     bool mTestLocalInbox;
     KWallet::Wallet *mWallet;
-    bool mErrorDialogShown;
 
     // Maps IDs on the server to message sizes on the server
     QMap<int,int> mIdsToSizeMap;