Bug 258271 - Going offline unintended during sync let operations fail silently.
Summary: Going offline unintended during sync let operations fail silently.
Status: VERIFIED FIXED
Alias: None
Product: KDE PIM Mobile
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Windows CE Microsoft Windows CE
: VHI critical
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: komo3
: 252028 252185 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-11-29 11:55 UTC by Sascha L. Teichmann
Modified: 2012-01-27 13:20 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha L. Teichmann 2010-11-29 11:55:27 UTC
If the first sync is still in progress and the machine
goes offline without user interaction operations starts
failing silently.

reproducible: yes

- Configure an account, start the sync, start writing a mail, 
  let the machine silently go offline, send the mail.
  The unfinished sync blocks sending the mail.

- If you manually go online again the sync does not recover.
  Restarting the app does not help.
  Only restarting the machine helps.

expected result: Prevent going offline if sync is in progress.

This is really annoying -> major (on the brink to critical)
Comment 1 Volker Krause 2010-11-29 16:29:57 UTC
*** Bug 252028 has been marked as a duplicate of this bug. ***
Comment 2 Volker Krause 2010-11-29 16:30:15 UTC
*** Bug 252185 has been marked as a duplicate of this bug. ***
Comment 3 Sascha L. Teichmann 2010-11-29 17:07:37 UTC
Talked to Andre H. and Bernhard R. We see it more on the critical side.
Comment 4 Volker Krause 2010-12-03 10:16:37 UTC
SVN commit 1203130 by vkrause:

Disable the session timeout for now, at least with such a small value it
causes more harm than good apparently.

BUG: 258271
CCBUG: 258361
CCBUG: 258378


 M  +1 -1      imapresource.kcfg  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1203130
Comment 5 Sascha L. Teichmann 2010-12-06 17:52:46 UTC
Does not work for me. Still going offline in sync. -> REOPEN
Comment 6 Volker Krause 2010-12-06 17:58:31 UTC
What's the resource status when this happens (online/syncing/offline, what status message)? Can be seen either in akonadiconsole or with recent versions in the accounts tab.
Comment 7 Sascha L. Teichmann 2010-12-06 18:11:31 UTC
(In reply to comment #6)
> What's the resource status when this happens (online/syncing/offline, what
> status message)? Can be seen either in akonadiconsole or with recent versions
> in the accounts tab.

Syncing collection 'holiday'
Comment 8 Bjoern Ricks 2010-12-06 19:00:36 UTC
It happened to me quite often today on WinCE. Mail still shows Syncing "Folder Abc" e.g Inbox
Comment 9 Volker Krause 2010-12-06 21:24:45 UTC
Please check if the akonadi_imap_resource process is still running when this happens. If not, please test with revision >= 1204255.
Comment 10 Tobias Koenig 2010-12-28 17:13:14 UTC
Hej,

Sascha/Björn any news on this topic?

Ciao,
Tobias
Comment 11 Bjoern Ricks 2011-01-13 13:06:08 UTC
It just happened to me during testing. Network connection got lost while syncing the imap account. In account menu the status got stuck with "Syncing collection 'xyz'" but the indicator still shows it's syncing.
Comment 12 Andre Heinecke 2011-01-20 16:53:07 UTC
SVN commit 1215969 by aheinecke:

- Update the status correctly when the Network Status changed
  and not only when the status of the connmanager created by
  solid changed.
- Check the online status by querying the adapters ( exposing
  Networking::checkStatus to avoid code duplication )
  instead of relying on the connmanager created by solid.
- Ignore the status of USB Serial connections.

CCBUG: 258271


 M  +6 -0      networking.h  
 M  +8 -0      networking_wince.cpp  
 M  +2 -2      networking_wince_p.h  
 M  +21 -10    networkingcontrolmanager_wince.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1215969
Comment 13 Andre Heinecke 2011-01-21 18:49:40 UTC
SVN commit 1216169 by aheinecke:

- Remove the use of private qt api. This did not work as intended
  so the status was never updated. When there was no instance of
  networkingcontrolmgr. (The minimalnetworkingclient used to test
  before does that)
- Instanciate WinCE Networking Control Manager because it handles
  the Window Messages notifing about a Network status change.
- Create the Networking control manager as a child window
  of the correct qt main window. So Messages are recive correctly
  even in multithreaded applications with multiple windows.
- Cleanup debug output a bit.

CCBUG: 258271
CCBUG: 263626
BUG: 263131



 M  +12 -23    networking_wince.cpp  
 M  +4 -0      networking_wince_p.h  
 M  +43 -7     networkingcontrolmanager_wince.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1216169
Comment 14 Volker Krause 2011-01-24 17:47:43 UTC
Possible fix for IMAP getting stuck due to network loss committed to kdepim-runtime in revision b01bb67.
Comment 15 Volker Krause 2011-01-26 09:08:44 UTC
Combined with Andre's work on the network state tracking, this should be fixed now.
Comment 16 Andre Heinecke 2011-02-15 19:06:35 UTC
I can verify that a sync correctly gets interrupted and continued later when the connection is lost on WinCE
Comment 17 David Faure 2012-01-05 11:17:37 UTC
Git commit 462d1ba23899dda3bc9d0abf6b0937754bf6c258 by David Faure.
Committed on 05/01/2012 at 12:01.
Pushed by dfaure into branch 'master'.

Fix crashes due to deleted Session pointers being kept around.

And fix LogoutJob never going through in the idle session, because the IdleJob
runs forever. The idle job has to be stopped, first.

Tested with kDebugs and using 'RMB / Toggle online/offline'

Both fixes suggested by Kévin when discussing the issue with him.
Related: bug 288268
FIXED-IN: 4.8

M  +3    -0    resources/imap/imapidlemanager.cpp
M  +2    -0    resources/imap/sessionpool.cpp

http://commits.kde.org/kdepim-runtime/462d1ba23899dda3bc9d0abf6b0937754bf6c258
Comment 18 David Faure 2012-01-06 12:17:52 UTC
Git commit d31715db768b477e8e5d7acaf852924f356c42e2 by David Faure.
Committed on 06/01/2012 at 12:33.
Pushed by dfaure into branch 'KDE/4.8'.

KTcpSocket: forward encryptedBytesWritten from QSslSocket.

Very important for the timeout detection in the akonadi imap resource.
write(5MB) gives an immediate bytesWritten(5MB), only encryptedBytesWritten
allows to see some regular activity on the socket.
Related: bug 258361

M  +1    -0    kdecore/network/ktcpsocket.cpp
M  +4    -0    kdecore/network/ktcpsocket.h

http://commits.kde.org/kdelibs/d31715db768b477e8e5d7acaf852924f356c42e2
Comment 19 David Faure 2012-01-06 12:18:23 UTC
Git commit 2bd26e7ea8e5799a60152ef4450edb30c11bd47b by David Faure.
Committed on 06/01/2012 at 12:40.
Pushed by dfaure into branch 'master'.

Fix wrong timeout when uploading/downloading large messages.

This fix requires the ktcpsocket encryptedBytesWritten signal added to kdelibs-4.8[.1?]
Related: bug 258361, bug 258378

M  +5    -0    kimap/session.cpp
M  +1    -0    kimap/session.h
M  +1    -0    kimap/session_p.h
M  +8    -1    kimap/sessionthread.cpp

http://commits.kde.org/kdepimlibs/2bd26e7ea8e5799a60152ef4450edb30c11bd47b
Comment 20 David Faure 2012-01-06 12:25:20 UTC
Git commit 679a05cb8ee30c81ea207b6cfc0e4131fd1a0c78 by David Faure.
Committed on 06/01/2012 at 13:21.
Pushed by dfaure into branch 'master'.

Restore the default timeout to 30s, after the kdelibs+kdepimlibs fixes.

The timeout doesn't trigger by mistake anymore on large emails,
so it can be restored to 30s, in order to fix the issues with
network disconnections, suspend/resume etc.
Related: bug 258378, bug 257722, bug 286047

M  +1    -1    resources/imap/imapresource.kcfg

http://commits.kde.org/kdepim-runtime/679a05cb8ee30c81ea207b6cfc0e4131fd1a0c78
Comment 21 Sebastian Trueg 2012-01-27 13:20:54 UTC
Git commit 0f4f6e97f84fe5cd10ebcafeb6676026f9efd486 by Sebastian Trueg, on behalf of David Faure.
Committed on 06/01/2012 at 12:33.
Pushed by trueg into branch 'KDE/4.8'.

KTcpSocket: forward encryptedBytesWritten from QSslSocket.

Very important for the timeout detection in the akonadi imap resource.
write(5MB) gives an immediate bytesWritten(5MB), only encryptedBytesWritten
allows to see some regular activity on the socket.
Related: bug 258361

M  +1    -0    kdecore/network/ktcpsocket.cpp
M  +4    -0    kdecore/network/ktcpsocket.h

http://commits.kde.org/kdelibs/0f4f6e97f84fe5cd10ebcafeb6676026f9efd486