Merge lp://qastaging/~renatofilho/sync-monitor/check-network into lp://qastaging/sync-monitor

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 53
Merged at revision: 38
Proposed branch: lp://qastaging/~renatofilho/sync-monitor/check-network
Merge into: lp://qastaging/sync-monitor
Diff against target: 837 lines (+338/-74)
13 files modified
CMakeLists.txt (+1/-0)
src/CMakeLists.txt (+4/-2)
src/eds-helper.cpp (+9/-4)
src/eds-helper.h (+1/-1)
src/sync-account.cpp (+11/-3)
src/sync-account.h (+1/-2)
src/sync-daemon.cpp (+155/-54)
src/sync-daemon.h (+10/-2)
src/sync-dbus.cpp (+14/-2)
src/sync-network.cpp (+51/-0)
src/sync-network.h (+48/-0)
src/sync-queue.cpp (+29/-4)
src/sync-queue.h (+4/-0)
To merge this branch: bzr merge lp://qastaging/~renatofilho/sync-monitor/check-network
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+239851@code.qastaging.launchpad.net

Commit message

Check for network connection before sync.
Append sync request to run later if no network.

To post a comment you must log in.
39. By Renato Araujo Oliveira Filho

Append sync request to run later if no network.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
40. By Renato Araujo Oliveira Filho

avoid infinity loop.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
41. By Renato Araujo Oliveira Filho

set m_syncing to false after cancel sync due network status.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
42. By Renato Araujo Oliveira Filho

Reverted to 60 ms wait before a sync;
Removed some debug messages from network helper class.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

Issues:
- if I turn off wifi, the sync still happens
- when wifi is on, as soon as I modify a contact the sync button goes gray but sync monitor delays 60 seconds until it starts the sync. The button shouldn't go gray until an actual sync is in progress. The delay before starting the sync seems much larger now.
- When I turn on flight mode, then sync monitor thinks I'm offline correctly. If I modify a contact during that time the sync button turns gray even though it's not syncing.

review: Needs Fixing
Revision history for this message
Bill Filler (bfiller) wrote :

Also, I rebooted with wifi turned off and I got a sync error. This was in the log:

"[10/28/14 6:48 PM] Start sync: <email address hidden> (contacts)"^M
Progress 0^M
Sync Report^M
         "dir" : "/home/phablet/.cache/syncevolution/google_+contacts_+14-2014-10-28-18-48
"^M
         "end" : "1414536541"^M
         "error" : "error code from SyncEvolution fatal error (local, status 10500): no so
urces active, check configuration"^M
         "peer" : "google-contacts-14"^M
         "start" : "1414536538"^M
         "status" : "10500"^M
"[10/28/14 6:49 PM] Sync done: <email address hidden> (contacts) Status: 10500 Error: Unknown s
tatus Duration: 2s"^M

This is with this MR installed to start sync-monitor after address-book and unity8: https://code.launchpad.net/~renatofilho/sync-monitor/start-after-unity8/+merge/239207

review: Needs Fixing
Revision history for this message
Renato Araujo Oliveira Filho (renatofilho) wrote :

> Issues:
> - if I turn off wifi, the sync still happens
> - when wifi is on, as soon as I modify a contact the sync button goes gray but
> sync monitor delays 60 seconds until it starts the sync. The button shouldn't
> go gray until an actual sync is in progress. The delay before starting the
> sync seems much larger now.
> - When I turn on flight mode, then sync monitor thinks I'm offline correctly.
> If I modify a contact during that time the sync button turns gray even though
> it's not syncing.

Yes I increased the delay to start the automatic sync. But it should not affect the manual sync ( I will check that).

Could you paste the sync-monitor log. It should show if the sync really happens or if it was postponed due the network.

The correct steps should be:

1 - Contact change
2 - Sync monitor waits 1 min (to avoid multiple syncs) before start the sync
3 - Sync monitor starts to sync
4 - Sync monitor checks network status
5 - If network is down postpone the sync until the network became available

Probably you are seeing the button gray (but this does not mean that the sync is happening, this mean that there is a sync in the queue). I will try to make the button gray only when syncing, to avoid problems.

43. By Renato Araujo Oliveira Filho

Update dbus helper class to only return state "syncing" when the sync is running and not during a pending sync.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
44. By Renato Araujo Oliveira Filho

Fixed sync state report.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

Here is the full log when the sync fails at startup:

"[10/29/14 7:49 AM] Start sync: <email address hidden> (contacts)"
Progress 0
Progress 0
Loaded tempaltes: ("google", "yahoo")
Loading accounts...
Found account: "<email address hidden>"
Supported sevices for protocol: "google" ("calendar", "contacts")
Services available for: "<email address hidden>" QMap(("calendar", false)("contacts", true))
Found account: "<email address hidden>"
Supported sevices for protocol: "google" ("calendar", "contacts")
Services available for: "<email address hidden>" QMap(("calendar", false)("contacts", true))
Found account: "bill.filler"
Found account: "bfiller"
Found account: "<email address hidden>"
syn requested for account: "<email address hidden>" "contacts"
Pushed into queue
Network state changed: Online
Network is online sync pending changes
Sync requested service: "<email address hidden>" "contacts"
Configure account for service: "<email address hidden>" "contacts" "disabled"
start configure for services ("contacts")
 config session created "google-contacts-14" "idle"
 account config done "<email address hidden>" "contacts"
"[10/29/14 11:55 AM] Start sync: <email address hidden> (contacts)"
Progress 0
Sync Report
  "dir" : "/home/phablet/.cache/syncevolution/google_+contacts_+14-2014-10-29-11-55"
  "end" : "1414598124"
  "error" : "error code from SyncEvolution fatal error (local, status 10500): no sources active, check configuration"
  "peer" : "google-contacts-14"
  "start" : "1414598121"
  "status" : "10500"
"[10/29/14 11:55 AM] Sync done: <email address hidden> (contacts) Status: 10500 Error: Unknown status Duration: 2s"
Network state changed: Offline
Network state changed: Online
Network is online sync pending changes
Sync error "<email address hidden>" "contacts" "canceled"

45. By Renato Araujo Oliveira Filho

Check queue size before start sync after network state changed.

46. By Renato Araujo Oliveira Filho

disable sync option is the server is not online.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
47. By Renato Araujo Oliveira Filho

Fixed sync in a loop when fails.
Fixed crash when sync get canceled due network going down.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
48. By Renato Araujo Oliveira Filho

Force sync to start if it was manually requested.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
49. By Renato Araujo Oliveira Filho

Set idle state in account where the sync was canceled.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
50. By Renato Araujo Oliveira Filho

Make sure that pending sync get synced after device went online.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
51. By Renato Araujo Oliveira Filho

delay sync after network went online to give it some time to full stabilish.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
52. By Renato Araujo Oliveira Filho

Automatically retry the sync for some buggy cases.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
53. By Renato Araujo Oliveira Filho

Fixed dbus sync state report.
Avoid sync the same account twice.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested according to "Test Network" section of test plan. All working.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches