Merge lp:~phablet-team/messaging-framework/maintain-connection-state into lp:messaging-framework

Proposed by Roberto Mier Escandon
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 73
Merged at revision: 70
Proposed branch: lp:~phablet-team/messaging-framework/maintain-connection-state
Merge into: lp:messaging-framework
Prerequisite: lp:~phablet-team/messaging-framework/limit-group-title-characters
Diff against target: 103 lines (+18/-8)
6 files modified
debian/changelog (+7/-0)
include/messaging/connection.h (+1/-1)
src/messaging/qt/network_monitor.cpp (+5/-2)
src/messaging/qt/tp/connection.cpp (+3/-3)
tests/mock_connection.h (+1/-1)
tests/unit/messaging/connection_test.cpp (+1/-1)
To merge this branch: bzr merge lp:~phablet-team/messaging-framework/maintain-connection-state
Reviewer Review Type Date Requested Status
system-apps-ci-bot continuous-integration Approve
Gustavo Pichorim Boiko (community) Approve
Review via email: mp+309150@code.launchpad.net

Commit message

Sets a reason when disconnecting, to differenciate if user requested disconnection or is it due to a network matter

Description of the change

Sets a reason when disconnecting, to differenciate if user requested disconnection or is it due to a network matter

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:72
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~phablet-team/messaging-framework/maintain-connection-state/+merge/309150/+edit-commit-message

https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-ci/88/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/1883
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/457
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1884
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1725/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1725/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1725/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1725/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1725/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1725/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1725/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1725/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1725
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1725/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-ci/88/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Continuous integration, rev:73
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~phablet-team/messaging-framework/maintain-connection-state/+merge/309150/+edit-commit-message

https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-ci/90/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1894/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1895
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1734
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1734/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1734
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1734/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1734
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1734/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1734
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1734/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1734
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1734/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1734
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1734/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1734
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1734/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1734
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1734/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1734/console

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-ci/90/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Just one question.

review: Needs Information
Revision history for this message
Roberto Mier Escandon (rmescandon) wrote :

Answered

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good!

review: Approve
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-autoland/35/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1903/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1904
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1741
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1741/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1741
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1741/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1741/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1741
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1741/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1741
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1741/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1741
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1741/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1741
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1741/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1741
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1741/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1741
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1741/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-autoland/36/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1910/console
    None: https://jenkins.canonical.com/system-apps/job/lp-generic-land-mp/53/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1911
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1750
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1750/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1750
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1750/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1750
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1750/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1750
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1750/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1750/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1750
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1750/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1750
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1750/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1750
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1750/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1750
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1750/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://jenkins.canonical.com/system-apps/job/lp-messaging-framework-autoland/37/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/system-apps/job/build/1911/console
    None: https://jenkins.canonical.com/system-apps/job/lp-generic-land-mp/54/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/1912
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1751
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1751/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1751
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1751/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1751
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=yakkety/1751/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1751
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1751/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1751/console
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1751
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=yakkety/1751/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1751
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/1751/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1751
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/1751/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1751
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=yakkety/1751/artifact/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-10-05 11:38:59 +0000
3+++ debian/changelog 2016-10-25 18:17:47 +0000
4@@ -1,3 +1,10 @@
5+messaging-framework (0.1+16.10.20161025-2ubuntu28) vivid; urgency=medium
6+
7+ * Added reason if calling disconnect() api method
8+ * Report dbus error if failed to validate group subject
9+
10+ -- Roberto Mier Escandon <roberto.escandon@canonical.com> Tue, 25 Oct 2016 13:46:47 +0200
11+
12 messaging-framework (0.1+16.10.20161005-1ubuntu28) vivid; urgency=medium
13
14 * Self identifier support
15
16=== modified file 'include/messaging/connection.h'
17--- include/messaging/connection.h 2016-10-05 11:37:10 +0000
18+++ include/messaging/connection.h 2016-10-25 18:17:47 +0000
19@@ -93,7 +93,7 @@
20 virtual void connect() = 0;
21
22 /// @brief login signs out from server if logged in
23- virtual void disconnect() = 0;
24+ virtual void disconnect(StatusChangedReason reason) = 0;
25
26 /// @brief normalize identifier
27 virtual std::string normalize_identifier(const std::string &id) = 0;
28
29=== modified file 'src/messaging/qt/network_monitor.cpp'
30--- src/messaging/qt/network_monitor.cpp 2016-07-18 11:42:37 +0000
31+++ src/messaging/qt/network_monitor.cpp 2016-10-25 18:17:47 +0000
32@@ -47,7 +47,7 @@
33 refresh_timer_.setSingleShot(true);
34 connect(&refresh_timer_,
35 SIGNAL(timeout()),
36- SLOT(idle_refresh()));
37+ SLOT(idle_refresh()), Qt::QueuedConnection);
38 }
39
40 /*!
41@@ -75,6 +75,8 @@
42 SIGNAL(updateCompleted()),
43 this,
44 SLOT(refresh()));
45+
46+ current_ssid_ = std::string{};
47 }
48
49 /*!
50@@ -119,7 +121,8 @@
51 auto sp = connection_.lock();
52 if (sp)
53 {
54- sp->disconnect();
55+ // disconnect, not specifying reason for fw try to reconnect when changed to a no connection status
56+ sp->disconnect(Connection::StatusChangedReason::network_error);
57 stop_monitoring();
58 }
59 }
60
61=== modified file 'src/messaging/qt/tp/connection.cpp'
62--- src/messaging/qt/tp/connection.cpp 2016-10-09 16:01:04 +0000
63+++ src/messaging/qt/tp/connection.cpp 2016-10-25 18:17:47 +0000
64@@ -245,11 +245,11 @@
65
66 void mqt::tp::Connection::onDisconnected()
67 {
68- setStatus(Tp::ConnectionStatusDisconnected, Tp::ConnectionStatusReasonRequested);
69-
70 try
71 {
72- connection->disconnect();
73+ // request the api a disconnection. The requested reason is because this case comes externally
74+ // by a telepathy disconnection of the plugin
75+ connection->disconnect(messaging::Connection::StatusChangedReason::requested);
76 network_monitor_.stop_monitoring();
77 }
78 catch (...)
79
80=== modified file 'tests/mock_connection.h'
81--- tests/mock_connection.h 2016-10-05 11:37:10 +0000
82+++ tests/mock_connection.h 2016-10-25 18:17:47 +0000
83@@ -50,7 +50,7 @@
84 MOCK_METHOD0(messenger, std::shared_ptr<messaging::Messenger>());
85 MOCK_METHOD0(group_starter, std::shared_ptr<messaging::GroupStarter>());
86 MOCK_METHOD0(connect, void());
87- MOCK_METHOD0(disconnect, void());
88+ MOCK_METHOD1(disconnect, void(StatusChangedReason));
89 MOCK_METHOD1(normalize_identifier, std::string(const std::string&));
90 MOCK_METHOD1(is_valid_identifier, bool(const std::string&));
91
92
93=== modified file 'tests/unit/messaging/connection_test.cpp'
94--- tests/unit/messaging/connection_test.cpp 2016-10-05 11:37:10 +0000
95+++ tests/unit/messaging/connection_test.cpp 2016-10-25 18:17:47 +0000
96@@ -51,7 +51,7 @@
97 }
98
99 void connect() {}
100- void disconnect() {}
101+ void disconnect(StatusChangedReason) {}
102 std::string normalize_identifier(const std::string& id) { return id; }
103 bool is_valid_identifier(const std::string &id) { return !id.empty(); }
104

Subscribers

People subscribed via source and target branches

to all changes: