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
=== modified file 'debian/changelog'
--- debian/changelog 2016-10-05 11:38:59 +0000
+++ debian/changelog 2016-10-25 18:17:47 +0000
@@ -1,3 +1,10 @@
1messaging-framework (0.1+16.10.20161025-2ubuntu28) vivid; urgency=medium
2
3 * Added reason if calling disconnect() api method
4 * Report dbus error if failed to validate group subject
5
6 -- Roberto Mier Escandon <roberto.escandon@canonical.com> Tue, 25 Oct 2016 13:46:47 +0200
7
1messaging-framework (0.1+16.10.20161005-1ubuntu28) vivid; urgency=medium8messaging-framework (0.1+16.10.20161005-1ubuntu28) vivid; urgency=medium
29
3 * Self identifier support10 * Self identifier support
411
=== modified file 'include/messaging/connection.h'
--- include/messaging/connection.h 2016-10-05 11:37:10 +0000
+++ include/messaging/connection.h 2016-10-25 18:17:47 +0000
@@ -93,7 +93,7 @@
93 virtual void connect() = 0;93 virtual void connect() = 0;
9494
95 /// @brief login signs out from server if logged in95 /// @brief login signs out from server if logged in
96 virtual void disconnect() = 0;96 virtual void disconnect(StatusChangedReason reason) = 0;
9797
98 /// @brief normalize identifier98 /// @brief normalize identifier
99 virtual std::string normalize_identifier(const std::string &id) = 0;99 virtual std::string normalize_identifier(const std::string &id) = 0;
100100
=== modified file 'src/messaging/qt/network_monitor.cpp'
--- src/messaging/qt/network_monitor.cpp 2016-07-18 11:42:37 +0000
+++ src/messaging/qt/network_monitor.cpp 2016-10-25 18:17:47 +0000
@@ -47,7 +47,7 @@
47 refresh_timer_.setSingleShot(true);47 refresh_timer_.setSingleShot(true);
48 connect(&refresh_timer_,48 connect(&refresh_timer_,
49 SIGNAL(timeout()),49 SIGNAL(timeout()),
50 SLOT(idle_refresh()));50 SLOT(idle_refresh()), Qt::QueuedConnection);
51}51}
5252
53/*!53/*!
@@ -75,6 +75,8 @@
75 SIGNAL(updateCompleted()),75 SIGNAL(updateCompleted()),
76 this,76 this,
77 SLOT(refresh()));77 SLOT(refresh()));
78
79 current_ssid_ = std::string{};
78}80}
7981
80/*!82/*!
@@ -119,7 +121,8 @@
119 auto sp = connection_.lock();121 auto sp = connection_.lock();
120 if (sp)122 if (sp)
121 {123 {
122 sp->disconnect();124 // disconnect, not specifying reason for fw try to reconnect when changed to a no connection status
125 sp->disconnect(Connection::StatusChangedReason::network_error);
123 stop_monitoring();126 stop_monitoring();
124 }127 }
125 }128 }
126129
=== modified file 'src/messaging/qt/tp/connection.cpp'
--- src/messaging/qt/tp/connection.cpp 2016-10-09 16:01:04 +0000
+++ src/messaging/qt/tp/connection.cpp 2016-10-25 18:17:47 +0000
@@ -245,11 +245,11 @@
245245
246void mqt::tp::Connection::onDisconnected()246void mqt::tp::Connection::onDisconnected()
247{247{
248 setStatus(Tp::ConnectionStatusDisconnected, Tp::ConnectionStatusReasonRequested);
249
250 try248 try
251 {249 {
252 connection->disconnect();250 // request the api a disconnection. The requested reason is because this case comes externally
251 // by a telepathy disconnection of the plugin
252 connection->disconnect(messaging::Connection::StatusChangedReason::requested);
253 network_monitor_.stop_monitoring();253 network_monitor_.stop_monitoring();
254 }254 }
255 catch (...)255 catch (...)
256256
=== modified file 'tests/mock_connection.h'
--- tests/mock_connection.h 2016-10-05 11:37:10 +0000
+++ tests/mock_connection.h 2016-10-25 18:17:47 +0000
@@ -50,7 +50,7 @@
50 MOCK_METHOD0(messenger, std::shared_ptr<messaging::Messenger>());50 MOCK_METHOD0(messenger, std::shared_ptr<messaging::Messenger>());
51 MOCK_METHOD0(group_starter, std::shared_ptr<messaging::GroupStarter>());51 MOCK_METHOD0(group_starter, std::shared_ptr<messaging::GroupStarter>());
52 MOCK_METHOD0(connect, void());52 MOCK_METHOD0(connect, void());
53 MOCK_METHOD0(disconnect, void());53 MOCK_METHOD1(disconnect, void(StatusChangedReason));
54 MOCK_METHOD1(normalize_identifier, std::string(const std::string&));54 MOCK_METHOD1(normalize_identifier, std::string(const std::string&));
55 MOCK_METHOD1(is_valid_identifier, bool(const std::string&));55 MOCK_METHOD1(is_valid_identifier, bool(const std::string&));
5656
5757
=== modified file 'tests/unit/messaging/connection_test.cpp'
--- tests/unit/messaging/connection_test.cpp 2016-10-05 11:37:10 +0000
+++ tests/unit/messaging/connection_test.cpp 2016-10-25 18:17:47 +0000
@@ -51,7 +51,7 @@
51 }51 }
5252
53 void connect() {}53 void connect() {}
54 void disconnect() {}54 void disconnect(StatusChangedReason) {}
55 std::string normalize_identifier(const std::string& id) { return id; }55 std::string normalize_identifier(const std::string& id) { return id; }
56 bool is_valid_identifier(const std::string &id) { return !id.empty(); }56 bool is_valid_identifier(const std::string &id) { return !id.empty(); }
5757

Subscribers

People subscribed via source and target branches

to all changes: