Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-87750

App started without internet doesn't gain it when it's available

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: Network
    • Labels:
      None
    • Platform/s:
      macOS, Windows

      Description

      Steps to reproduce:

      1. Turn off Wi-Fi.
      2. Start the attached app.
      3. `QNetworkReply::UnknownNetworkError` errors start flowing in.
      4. Turn Wi-Fi back on.
      5. All subsequent requests still fail with `QNetworkReply::UnknownNetworkError`, network connectivity is never regained.

      This problem occurs for `QNetworkAccessManager` instances created during network unavailability. It does not occur on Linux.

      It's very similar to QTBUG-49760, the only difference is that we disable the network prior to starting the app (compared to doing so while it's running).

      Workarounds we found:

      • using deprecated `nam.setNetworkAccessible(QNetworkAccessManager::Accessible)` yields `QNetworkReply::HostNotFoundError` errors instead and successes to complete requests once network is regained,
      • don't cache `QNetworkAccessManager` instance.

        Attachments

        1. main.cpp
          0.7 kB
          Krzysztof Potrzasaj
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            tpochep Timur Pocheptsov
            Reporter:
            eck Krzysztof Potrzasaj
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes