Skip to content

[go_router] Redirect history clear when using Future in redirect function  #113159

Closed

Description

@PranayDosii

The redirect function works fine when I am not using the async but when I try to use the async in the redirect function
It clears the routing history.

sample code

redirect: (context, state) async {
   var data =  await loginStatus(); 
   return null;
 }

Activity

  1. changed the title [-]Redirect history clear when using `Future` in `redirect` function[/-] [+]Redirect history clear when using `Future` in `redirect` function #Go_Router[/+] on Oct 8, 2022
  2. changed the title [-]Redirect history clear when using `Future` in `redirect` function #Go_Router[/-] [+]Redirect history clear when using `Future` in `redirect` function [/+] on Oct 8, 2022
  3. changed the title [-]Redirect history clear when using `Future` in `redirect` function [/-] [+][Go Router] Redirect history clear when using `Future` in `redirect` function [/+] on Oct 8, 2022
  4. changed the title [-][Go Router] Redirect history clear when using `Future` in `redirect` function [/-] [+][go_router] Redirect history clear when using `Future` in `redirect` function [/+] on Oct 10, 2022
  5. changed the title [-][go_router] Redirect history clear when using `Future` in `redirect` function [/-] [+]p:[go_router] Redirect history clear when using `Future` in `redirect` function [/+] on Oct 10, 2022
  6. changed the title [-]p:[go_router] Redirect history clear when using `Future` in `redirect` function [/-] [+][go_router] Redirect history clear when using `Future` in `redirect` function [/+] on Oct 10, 2022
  7. added
    in triage
    on Oct 10, 2022
  8. darshankawar commented on Oct 10, 2022

    @darshankawar
    Member

    @PranayDosii
    Can you provide flutter doctor -v, a complete minimal reproducible code sample along with actual vs expected behavior ?
    Thanks.

  9. added
    waiting for response
    on Oct 10, 2022
  10. PranayDosii commented on Oct 10, 2022

    @PranayDosii
    Author

    flutter doctor -v I tried with the latest version of go_router but this issue still exists

    [✓] Flutter (Channel stable, 3.3.0, on macOS 12.3.1 21E258 darwin-arm, locale en-IN)
        • Flutter version 3.3.0 on channel stable at /Users/dosii/Documents/flutter_2
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ffccd96b62 (6 weeks ago), 2022-08-29 17:28:57 -0700
        • Engine revision 5e9e0e0aa8
        • Dart version 2.18.0
        • DevTools version 2.15.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
        • Android SDK at /Users/dosii/Library/Android/sdk
        • Platform android-33, build-tools 33.0.0
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 13F100
        • CocoaPods version 1.11.3
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2021.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    
    [✓] VS Code (version 1.71.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.50.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
        • Chrome (web)    • chrome • web-javascript • Google Chrome 105.0.5195.125
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    

    Sample video

    This is happening only when I am using async in the redirect function
    You can see when I try to reload the site it clears the routs history

  11. removed
    waiting for response
    on Oct 10, 2022
  12. darshankawar commented on Oct 10, 2022

    @darshankawar
    Member

    Check if this issue is similar to your case. If not, we would need a minimal but complete code sample.

  13. added
    waiting for response
    on Oct 10, 2022
  14. PranayDosii commented on Oct 10, 2022

    @PranayDosii
    Author

    This same issue is happening to me also the go_router clearing the routing history

  15. removed
    waiting for response
    on Oct 10, 2022
  16. darshankawar commented on Oct 11, 2022

    @darshankawar
    Member

    We would need a complete minimal reproducible code sample to make this issue actionable.

  17. added
    waiting for response
    on Oct 11, 2022
  18. github-actions commented on Nov 1, 2022

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  19. github-actions commented on Nov 15, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  20. locked as resolved and limited conversation to collaborators on Nov 15, 2022
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 triagewaiting for response

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions