Skip to content

Improve messaging when trying to connect to an app in release mode #4273

Closed

Description

@johnpryan

When an app is running in release mode, and I run the "Open DevTools in Web Browser" command, I get this warning:

Screenshot 2022-11-17 at 12 31 48 PM

Could we detect when the launch configuration's flutterMode is set to release and point users to the documentation?

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Nov 17, 2022
  2. DanTup commented on Nov 23, 2022

    @DanTup
    Member

    @johnpryan are you using current stable Flutter? I changed this message in 68cf41f but it requires flutter/flutter#106337 (in theory we might be able to check the mode another way, but since this is already I'm inclined to just wait for it to ship).

    I will add a "More info" button that links to those docs though.

  3. DanTup commented on Nov 23, 2022

    @DanTup
    Member

    @johnpryan can you confirm exactly where we should link to? The link above seems to be related to profile mode, but this issue is only about release mode?

  4. johnpryan commented on Nov 23, 2022

    @johnpryan
    Author

    That's a good point, the Flutter performance profiling page isn't quite right because it's also common to use DevTools in Debug mode. I'm not sure we have a place in our docs that says DevTools should only be run in Debug or Profile mode, not Release mode.

  5. DanTup commented on Nov 23, 2022

    @DanTup
    Member

    Ah, in that case is there anything else to do here? The current message (when running on latest code) says:

    DevTools is not available for an app running in this mode.

    We could make this more specific (release/profile mode), however it requires making some assumptions in VS Code that I'd rather avoid (there are many ways the user could start the app in profile/release mode that are harder for us to detect).

  6. added
    awaiting infoRequires more information from the customer to progress
    on Nov 23, 2022
  7. johnpryan commented on Nov 23, 2022

    @johnpryan
    Author

    I would prefer if it said "DevTools only supports Debug or Profile mode". The current gives two possible explanations, which can lead to confusion and doesn't tell the user how to resolve the issue.

    Is there a way to detect that the debug session isn't ready yet so that we can disambiguate these two scenarios?

  8. DanTup commented on Nov 23, 2022

    @DanTup
    Member

    I would prefer if it said "DevTools only supports Debug or Profile mode".

    Isn't it the case that profile mode for Web doesn't support DevTools (it doesn't have a VM Service)? (see flutter/devtools#3969 (comment)). If so, could it be confusing to say it's only available in debug/profile mode if the user is running a profile (web) build?

    Is there a way to detect that the debug session isn't ready yet so that we can disambiguate these two scenarios?

    That's what the changes above do. With the latest code (if you're using Flutter master (or beta?)) we will show the new message posted above if we know the debug session has started, and otherwise show the old one (from your screenshot). In a future release, we could drop the "or does not support DevTools" part from that last message so that last message is less vague.

    if (session.vmServiceUri) {
    return this.devTools.spawnForSession(session as DartDebugSessionInformation & { vmServiceUri: string }, { notify, page });
    } else if (session.session.configuration.noDebug) {
    vs.window.showInformationMessage("You must start your app with debugging in order to use DevTools.");
    } else if (session.hasStarted) {
    vs.window.showInformationMessage("DevTools is not available for an app running in this mode.");
    } else {
    // TODO: Remove the last part of this after the next Flutter release (after 3.0) when the appStarted event
    // is passed.
    vs.window.showInformationMessage("This debug session is not ready yet or does not support DevTools.");
    }

  9. johnpryan commented on Nov 29, 2022

    @johnpryan
    Author

    Isn't it the case that profile mode for Web doesn't support DevTools

    That's a good point, maybe we could link to a compatibility table in the docs or something...

    In a future release, we could drop the "or does not support DevTools"

    Sounds good

  10. johnpryan commented on Nov 29, 2022

    @johnpryan
    Author
  11. johnpryan commented on Nov 29, 2022

    @johnpryan
    Author

    I filed an issue to add a warning about web support flutter/website#7887

  12. DanTup commented on Nov 30, 2022

    @DanTup
    Member

    That's a good point, maybe we could link to a compatibility table in the docs or something...

    Is there an existing one I can link to? If not, if we can add one I can add a "more info" button here to link to it.

  13. added this to the v3.56.0 milestone on Nov 30, 2022
  14. johnpryan commented on Dec 6, 2022

    @johnpryan
    Author

    No, I don't think we have a compatibility table in the docs right now.

  15. 13 remaining items

  16. modified the milestones: v3.60.0, On Deck on Feb 27, 2023
  17. github-actions commented on Mar 20, 2023

    @github-actions

    This issue has been marked stale because it is tagged awaiting-info for 20 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.

  18. johnpryan commented on Mar 21, 2023

    @johnpryan
    Author

    "DevTools is not available for [mode] mode on device [deviceId]" would definitely help here, the table at https://dart.dev/tools/dart-devtools is also handy, but doesn't contain any information about whether the user is in run/profile/release mode

  19. removed
    awaiting infoRequires more information from the customer to progress
    on Mar 30, 2023
  20. modified the milestones: On Deck, v3.62.0 on Mar 30, 2023
  21. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Mar 30, 2023
  22. DanTup commented on Mar 30, 2023

    @DanTup
    Member

    Ok, I've updated so it'll look like this:

    Screenshot 2023-03-30 at 14 11 36

    It requires both flutter/flutter#121239 and a change here in the VS Code extension, so it'll still show the old message until you're using updated versions of each.

    I haven't added a link to the page above for now, since it doesn't mention modes - however if it's reasonable for that page to be updated to mention modes, we could easily add a button here.

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 flutterRelates to running Flutter appsis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions