diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-07 14:21:44 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-04-07 14:50:15 +0200 |
commit | 9fdcedf88e2fabedad73f0c74906318673f1ffa0 (patch) | |
tree | eceba5dfb03e59c483ad83af8ae220894083473a /tests | |
parent | 8c7924171942f5f0d25c8a02f66d82f5be6edb5b (diff) | |
download | sink-9fdcedf88e2fabedad73f0c74906318673f1ffa0.tar.gz sink-9fdcedf88e2fabedad73f0c74906318673f1ffa0.zip |
Better account status aggregation.
Only ever enter error state on non-recoverable errors.
Otherwise:
* Busy state while busy, then go back to online/offline/error.
* If we failed connect during replay/sync we assume we're offline.
* If we failed to login but could connect we have a known error
condition.
* If we succeeded to replay/sync something we are apprently online.
At the core we have the problem that we have no way of telling wether
we can connect to the server until we actually try (network is not
enough: vpns, firewalls, ....). Further the status always reflects the
latest status, so even if we were in an error state, once we retry we go
out of the error state and either end up back in the error state or not.
When aggregating states we have to similarly adjust the state to the
most relevant among the resources. The states are ordered like this:
* Error
* Busy
* Connected
* Offline
Diffstat (limited to 'tests')
-rw-r--r-- | tests/notificationtest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/notificationtest.cpp b/tests/notificationtest.cpp index 375bfc4..a34d325 100644 --- a/tests/notificationtest.cpp +++ b/tests/notificationtest.cpp | |||
@@ -71,8 +71,8 @@ private slots: | |||
71 | QTRY_COMPARE(statusNotifications.size(), 3); | 71 | QTRY_COMPARE(statusNotifications.size(), 3); |
72 | //Sync | 72 | //Sync |
73 | QCOMPARE(statusNotifications.at(0).code, static_cast<int>(ApplicationDomain::Status::ConnectedStatus)); | 73 | QCOMPARE(statusNotifications.at(0).code, static_cast<int>(ApplicationDomain::Status::ConnectedStatus)); |
74 | QCOMPARE(statusNotifications.at(1).code, static_cast<int>(Sink::ApplicationDomain::Status::BusyStatus)); | 74 | QCOMPARE(statusNotifications.at(1).code, static_cast<int>(ApplicationDomain::Status::BusyStatus)); |
75 | QCOMPARE(statusNotifications.at(2).code, static_cast<int>(Sink::ApplicationDomain::Status::ConnectedStatus)); | 75 | QCOMPARE(statusNotifications.at(2).code, static_cast<int>(ApplicationDomain::Status::ConnectedStatus)); |
76 | //Changereplay | 76 | //Changereplay |
77 | // It can happen that we get a changereplay notification pair first and then a second one at the end, | 77 | // It can happen that we get a changereplay notification pair first and then a second one at the end, |
78 | // we therefore currently filter all changereplay notifications (see above). | 78 | // we therefore currently filter all changereplay notifications (see above). |