You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to open static DevTools extensions on current Flutter beta #5208
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:
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)
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.
Another minor consequence of this is that trying to launch the static tool while a debug session is start will result in this:
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).
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).
Another minor consequence of this is that trying to launch the static tool while a debug session is start will result in this:
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.
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?
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?
Activity
DanTup commentedon Aug 1, 2024
Another minor consequence of this is that trying to launch the static tool while a debug session is start will result in this:
Because with
prefersDebugSessionwe 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).DanTup commentedon Aug 1, 2024
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).
kenzieschmoll commentedon Aug 1, 2024
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.
DanTup commentedon Aug 1, 2024
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?
kenzieschmoll commentedon Aug 1, 2024
This is a fair point. Sgtm to leave as is then.
Downgrade from requiresDebugSession to prefersDebugSession for extens…