Skip to content

[http] Requests fail with SocketException when flutter app goes in to backgroundΒ #1817

@KingRial

Description

@KingRial

Just wanted to let you know that this issue is still present on android devices: #877

I discovered the problem while using the openid_client (https://pub.dev/packages/openid_client).
I configured the authentication process to use an external browsers (See appsup-dart/openid_client#128 for more details) and this is what happens:

  • When the authentication process starts the App goes in background and open a browser to desired authentication server URL
  • When you log in the browser will be redirected to localhost:4000 with all the relevant data
  • However the openUrl on
    var ioRequest = (await _inner!.openUrl(request.method, request.url))
    fails with the "ClientException with SocketException: Failed host lookup: 'xxx.yyy.zzz' (OS Error: No address associated with hostname, errno = 7)" since the App has been put on background (and the browser is still on foreground)

If you use an inApp webview the problem doesn't occur (since the app is still on foreground)

Metadata

Metadata

Assignees

No one assigned

    Labels

    package:httptype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions