Merge lp:~matzipan/capnet-assist/fix-on-no-network into lp:~elementary-apps/capnet-assist/trunk

Proposed by Zisu Andrei
Status: Needs review
Proposed branch: lp:~matzipan/capnet-assist/fix-on-no-network
Merge into: lp:~elementary-apps/capnet-assist/trunk
Diff against target: 15 lines (+0/-6)
1 file modified
src/Application.vala (+0/-6)
To merge this branch: bzr merge lp:~matzipan/capnet-assist/fix-on-no-network
Reviewer Review Type Date Requested Status
elementary Apps team Pending
Review via email:

Description of the change

This code is logically broken. With it, in all cases when a connection is faulty, the method will return true (which means it detected a captive portal). Which would give a lot of false positives.

On faulty internet connections, this code will cause the capnet to pop up for a split second before closing again.

To post a comment you must log in.
Revision history for this message
Corentin Noël (tintou) wrote :

Shouldn't it return false then ?

Revision history for this message
Danielle Foré (danrabbit) wrote :

I believe that here FULL is according to network manager, which it would be even if it was a captive portal. so it's supposed to bail out if we're not connected to "the internet" (as far as network manager knows). This is to protect against launching capnet on intranets

Revision history for this message
Zisu Andrei (matzipan) wrote :

No, it shouldn't, that's the english equivalent of saying "if it's not a full connection, it's not a captive portal", which would imply captive portals only have full connectivity, which by definition is not what a captive portal is.

And if it returns true (like it is in trunk), it means that _everything_ that is not a full connection, is a captive portal. Which again is not true (for example, faulty internet connections or some internet connections).

@Dan capnet will not be launched on intranets because the connectivity request after will not return 200.

Revision history for this message
Zisu Andrei (matzipan) wrote :

In my last comment, replace "some internet connections" with "some intranet connections"

Unmerged revisions

125. By Zisu Andrei

Fix capnet popping up when no network connection is available

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Application.vala'
2--- src/Application.vala 2016-09-08 21:00:07 +0000
3+++ src/Application.vala 2016-12-20 19:15:01 +0000
4@@ -28,12 +28,6 @@
5 private bool is_captive_portal () {
6 var network_monitor = NetworkMonitor.get_default ();
8- // No connection is available at the moment, don't bother trying the
9- // connectivity check
10- if (network_monitor.get_connectivity () != NetworkConnectivity.FULL) {
11- return true;
12- }
14 var page = "";
15 debug ("Getting 204 page");


People subscribed via source and target branches

to all changes: