Code review comment for lp:~matzipan/capnet-assist/no-internet-fix

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

I am failing to see how the previous code took into account "history" either.

The check is still performed on line 52:
  if (browser.is_captive_portal ()) {

When you join a network, it will check if it can connect to the android URL.

If it is in a captive network and the captive portal triggers, then it will get redirected to the captive portal and soup will return the 200 status code, which means is_captive_portal will return true.

If it is in a captive network and the captive portal does not trigger (which I assume is the previously known network you're reffering to), then it means it will connect to the android connectivity checker URL, so soup will return the 204 status code, in which case is_captive_portal will return false - so the window won't even open in the first place.

It you are in a network without internet connection, before, soup would've returned status code 2, which meant that the assistant's window launched, but there was no website to display, since status code 2 means something along the lines of "connection timeout". After my changes, soup returning status 2 is ignored and is_captive_portal returns false.

« Back to merge proposal