Skip to content

For web apps, Web-Server is picked over Chrome by default #2453

Closed

Description

@DanTup

Not sure if this changed recently, but for web apps when there's only Chrome + Web Server, it seems to default to Web Server which is not what most people want.

We can handle this with an exclusion in Dart-Code, though I wonder if it's worth addressing in Flutter. We currently have an ephemeral boolean that lets us prefer devices that are explicitly connected, but maybe there should also (or instead) be a priority, and we only switch if the newly connected device is >= the priority of the current device? (@jonahwilliams)

Activity

  1. added this to the v3.11.0 milestone on May 13, 2020
  2. jonahwilliams commented on May 13, 2020

    @jonahwilliams

    Is the order of returned devices used? It's not great, but I can document and test this

  3. DanTup commented on May 13, 2020

    @DanTup
    MemberAuthor

    Yeah, right now they come through in this order:

    [12:17:39 PM] [FlutterDaemon] [Info] <== [{"event":"device.added","params":{"id":"web-server","name":"Web Server","platform":"web-javascript","emulator":false,"category":"web","platformType":"web","ephemeral":false,"emulatorId":null}}]
    [12:17:39 PM] [FlutterDaemon] [Info] <== [{"event":"device.added","params":{"id":"chrome","name":"Chrome","platform":"web-javascript","emulator":false,"category":"web","platformType":"web","ephemeral":false,"emulatorId":null}}]
    

    When the first device comes through (web-server), we select it because we don't have any other device. When the second device (Chrome) comes through, we do not select it because we already have a selected device and the new device is not marked ephemeral.

  4. DanTup commented on May 13, 2020

    @DanTup
    MemberAuthor

    I've put specific handling in here for allowing Chrome to override Web-Server when it's added. If we get something better in Flutter, I can remove it in future - but since a Flutter stable release with any change is likely some way off, having it in the next release here seems worthwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions