Skip to content

Unable to open static DevTools extensions on current Flutter beta #5208

Closed

Description

@DanTup

Using the current Flutter beta and opening the app_that_uses_foo project, the sidebar shows the extension but fails to launch if there is not debug session.

This is because the requiresDebugSession flag defaults to true (sidebar does not currently pass it) unless we know that the target is a static page (which we only do for 1p pages, because they are hard-coded into Dart-Code).

As a workaround until sidebar is passing the flags, we should:

  • if the target page is an _ext page and neither requiresDebugSession or prefersDebugSession are explicitly set
  • downgrade from requiresDebugSession to prefersDebugSession

This fixes the issue, but there are some side-effects or doing this:

  1. Attempting to launch a static tool when there are > 1 debug sessions active will prompt the user to select one (even though the tool won't use it)
  2. Attempting to launch a runtime tool when there are no active sessions will launch the tool without a connection (instead of doing nothing)

Discussing with @kenzieschmoll, the first is acceptable and the second should not generally happen because the sidebar disables the runtime tool buttons when it knows there are no active debug sessions.

Activity

  1. added
    in devtoolsRelates to integration with Dart/Flutter DevTools
    in flutter sidebarRelates to something in the "Flutter sidebar" that's provided via DevTools
    on Aug 1, 2024
  2. added this to the v3.94.0 milestone on Aug 1, 2024
  3. DanTup commented on Aug 1, 2024

    @DanTup
    MemberAuthor

    Another minor consequence of this is that trying to launch the static tool while a debug session is start will result in this:

    image

    Because with prefersDebugSession we will select the debug session but can't proceed if we don't have the VM Service URI yet. I think this is an edge case we'll have to life with (once the flags are set explicitly, this is all moot).

  4. DanTup commented on Aug 1, 2024

    @DanTup
    MemberAuthor

    With this fix, all the buttons in the sidebar seem to work as we would expect (using current Flutter beta, and the current extension code from master which which will ship in todays release).

  5. kenzieschmoll commented on Aug 1, 2024

    @kenzieschmoll

    Another minor consequence of this is that trying to launch the static tool while a debug session is start will result in this:

    image

    Because with prefersDebugSession we will select the debug session but can't proceed if we don't have the VM Service URI yet. I think this is an edge case we'll have to life with (once the flags are set explicitly, this is all moot).

    It seems like we should still launch the tool as if there are no debug sessions even when there is one that is in the process of stating up.

  6. DanTup commented on Aug 1, 2024

    @DanTup
    MemberAuthor

    It seems like we should still launch the tool as if there are no debug sessions even when there is one that is in the process of stating up.

    I feel like this could be unexpected or confusing. To users it might not be clear that when they start a debug session there is some time (eg. compilation) where we can't access the VM Service URI. If they start a debug session and then while it's building try to open something like CPU Profiler ready (or expect to profile startup), we would open an unconnected version of it without any obvious way to connect it to their app once it loads.

    I think if they're trying to open a tool while a debug session is starting, then probably they're expecting to use it for that debug session?

  7. kenzieschmoll commented on Aug 1, 2024

    @kenzieschmoll

    I feel like this could be unexpected or confusing. To users it might not be clear that when they start a debug session there is some time (eg. compilation) where we can't access the VM Service URI. If they start a debug session and then while it's building try to open something like CPU Profiler ready (or expect to profile startup), we would open an unconnected version of it without any obvious way to connect it to their app once it loads.

    I think if they're trying to open a tool while a debug session is starting, then probably they're expecting to use it for that debug session?

    This is a fair point. Sgtm to leave as is then.

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

    in devtoolsRelates to integration with Dart/Flutter DevToolsin flutter sidebarRelates to something in the "Flutter sidebar" that's provided via DevToolsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions