After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 312668 - Unable to go back to Online mode after clicking offline button...
Unable to go back to Online mode after clicking offline button...
Status: VERIFIED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.4.x (obsolete)
Other All
: Normal major
: ---
Assigned To: Not Zed
Evolution QA team
: 255837 313288 313518 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-08-05 12:10 UTC by Krishnan R
Modified: 2013-09-13 00:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Code fix not Bug fix (878 bytes, patch)
2005-08-09 10:27 UTC, Shreyas Srinivasan
none Details | Review
remove unused rubbish in excahgne code (5.33 KB, patch)
2005-08-17 07:07 UTC, Not Zed
committed Details | Review
new offline interface in mail shell and remove crap in calendar (71.97 KB, patch)
2005-08-17 07:08 UTC, Not Zed
none Details | Review
updated evolution patch (72.25 KB, patch)
2005-08-17 08:04 UTC, Not Zed
committed Details | Review
fixes some problems with cancelling going offline (3.88 KB, patch)
2005-08-19 07:16 UTC, Not Zed
committed Details | Review
go offline/online in the right order (1.83 KB, patch)
2005-08-19 07:16 UTC, Not Zed
committed Details | Review

Description Krishnan R 2005-08-05 12:10:35 UTC
Please describe the problem:
This is happening on 5th August build.   Mail access thru iMAP

I click on the offline button to get to offline mode.  I send some emails in
offline mode which puts it in the outbox.   Now, I need to go to Online mode to
send it.   I can't press on the offline/online button since it is disabled. 
Neither I could click File->Work Online since it is also disabled.

The only way to go to online is to restart evolution.

Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:
The offline/online buttion should turn offline with an red cross in between.
The 'File' menu should have "Work Online" option which should bring back
evolution to online mode.  Today it still says "Work Offline" after going to
offline.

Also, upon restarting evolution, it should stay in offline mode.

Does this happen every time?
Always

Other information:
Comment 1 Not Zed 2005-08-09 04:45:54 UTC
bumping pri. i keep missing shres on irc when he's discussing it.

i think it's due to some changes to camel-disco-store i made for imap to work. 
but the logic in some of the mail-offline-handler is all wrong anyway, it is
using the camel-store connected state to check the camel-disco-store online
state, which are not compatible variables.

anyway, the shell interfaces are stupid, it doesn't need to know about the
details of which stores are going offline and should either just have a single
'finished' event, or the set line status method should be synchronous.

Comment 2 Shreyas Srinivasan 2005-08-09 08:46:38 UTC
So, I changed the service_is_relevant to do the correct variable check like this 

if (CAMEL_IS_DISCO_STORE (service) &&
	    (!camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (service)))) 

and now the correct code path seems to get hit. 

went_offline
set_offline_done 

get hit. Which means that the offline process is done. But the progress listener
does not get updated.

In went_offline there are segments of code 

GNOME_Evolution_OfflineProgressListener_updateProgress(listener,
connection_list, &ev);
.
.
CORBA_free (connection_list);

which should typically tell the progress listener that all the connections have
been dropped. So its either that the connections are not really being dropped or
something is borked in how went_offline is tracking connections.

Comment 3 Not Zed 2005-08-09 09:05:30 UTC
All of this stuff:

GNOME_Evolution_OfflineProgressListener_updateProgress(listener,
connection_list, &ev);
.
.
CORBA_free (connection_list);

Is actually redundant now.  It used to be used to update the pointless window
telling youwhat was still online; but now it isn't shown anywhere, so is just a
waste of api to implement.

Can you please attach the patch here, thanks
Comment 4 Shreyas Srinivasan 2005-08-09 10:27:43 UTC
Created attachment 50449 [details] [review]
Code fix not Bug fix

Attaching a patch which seems to be the partial soln. Please note this *does
not* fix the bug. Just seems to fix some part of the code.
Comment 5 Shreyas Srinivasan 2005-08-12 12:53:02 UTC
In camel-disco-store.c:set_status()

	if (!camel_service_disconnect (CAMEL_SERVICE (disco_store), TRUE, ex)) {
		g_print ("wow it could not be this truly, not\n");
		return;
	}

camel_service_disconnect returns true which means it failed. If this fails then 

	Disco_store->status = status;
	camel_service_connect (CAMEL_SERVICE (disco_store), ex);

gets executed and the offlining icon never returns. If i comment out
camel_service_connect then the icon gets toggled but ofcourse
camel_service_disconnect would have failed so the store is still online. 

I am yet to figure out why camel_service_disconnect would fail...
Comment 6 Not Zed 2005-08-15 04:00:48 UTC
"camel_service_disconnect returns true which means it failed."

Umm, wrong ... even the documentation says otherwise.

* Returns %TRUE if the disconnect was successful or %FALSE otherwise
 **/
gboolean
camel_service_disconnect (CamelService *service, gboolean clean,
			  CamelException *ex)


Anyway my last suggestion was to ignore the disco state and just ALWAYS set the
state on it.  As i said repeatedly, you can re-set the same state safely - or if
you can't the code needs fixing so you can.

This no good:

+	    (!camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (service))))
 			return !going_offline;

It should return TRUE always.


Also this:
"camel_service_disconnect returns true which means it failed. If this fails then 
	Disco_store->status = status;
	camel_service_connect (CAMEL_SERVICE (disco_store), ex);"

Connecting a service has NOTHING to do with "being online".  It applies equally
well to a store in offline state.


Comment 7 Shreyas Srinivasan 2005-08-16 09:28:32 UTC
*** Bug 313518 has been marked as a duplicate of this bug. ***
Comment 8 Not Zed 2005-08-17 05:34:53 UTC
This no good:

+	    (!camel_disco_store_can_work_offline (CAMEL_DISCO_STORE (service))))
 			return !going_offline;

It should return TRUE always.


So that statement was wrong, but it wasn't hard to see that when looking at how
the code worked.  The offline interface is just rubbish, so i've removed it
entirely, patches coming soon.
Comment 9 Not Zed 2005-08-17 07:07:22 UTC
Created attachment 50836 [details] [review]
remove unused rubbish in excahgne code
Comment 10 Not Zed 2005-08-17 07:08:05 UTC
Created attachment 50837 [details] [review]
new offline interface in mail shell and remove crap in calendar
Comment 11 Not Zed 2005-08-17 08:04:52 UTC
Created attachment 50844 [details] [review]
updated evolution patch
Comment 12 Not Zed 2005-08-17 08:23:49 UTC
*** Bug 313288 has been marked as a duplicate of this bug. ***
Comment 13 Not Zed 2005-08-17 08:31:01 UTC
*** Bug 255837 has been marked as a duplicate of this bug. ***
Comment 14 Not Zed 2005-08-19 07:15:28 UTC
still issues with patches
Comment 15 Not Zed 2005-08-19 07:16:13 UTC
Created attachment 50977 [details] [review]
fixes some problems with cancelling going offline
Comment 16 Not Zed 2005-08-19 07:16:44 UTC
Created attachment 50978 [details] [review]
go offline/online in the right order
Comment 17 Nagappan Alagappan 2005-08-26 13:33:20 UTC
Verified with local IMAP and Groupwise server with Evolution 2.3.8