Skip to content

Severe navigator fail on iOS (swipe back) since newest stable upgrade #28728

Closed

Description

@msw333

See video for demonstration:
https://youtu.be/cwzUr5-vN_M

Severe issue since the new stable upgrade (1day ago). Reproducible on any tap-able item, when simple using navigator.push to get to a new screen on iOS. Just tap on an item and swipe back via iOS gesture, then quickly tap the item again. New screen is shortly opened, then closed. Sometimes, this error message pops up:
#28058

Activity

  1. added
    c: regressionIt was better in the past than it is now
    p: cupertino_uicupertino_ui package in flutter/packages
    f: routesNavigator, Router, and related APIs.
    on Mar 1, 2019
  2. cbracken commented on Mar 1, 2019

    @cbracken
    Member
  3. HansMuller commented on Mar 1, 2019

    @HansMuller
    Contributor

    @cbracken you removed the cupertino label because this problem occurs on Android?

  4. HansMuller commented on Mar 1, 2019

    @HansMuller
    Contributor

    I was able to reproduce the problem with a simple test case using platform: TargetPlatform.iOS (on an Android device): https://gist.github.com/HansMuller/3b26fbbd445764e0e54e95ba64acc156

    The failure occurs in _CupertinoBackGestureController after dismissing pushing a route and then dismissing it with a backswipe a few times. Looking into it.

  5. HansMuller commented on Mar 1, 2019

    @HansMuller
    Contributor

    The problem seems to be due to the order in which the route's transition animation status listeners are added/run. TransitionRoute adds a listener that disposes the route (with finalizeRoute()):

    https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/widgets/routes.dart#L159

    The Cupertino back gesture handler does as well:

    https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/cupertino/route.dart#L655

    If the TransitionRoute's listener runs first the route is disposed before the back gesture handler tries to Navigator.pop it.

    Still trying to understand how this is supposed to work, what causes the transition route's listener to run first, etc.

  6. HansMuller commented on Mar 1, 2019

    @HansMuller
    Contributor

    Working with @xster on this and think we've found a solution. Writing tests.

  7. HansMuller commented on Mar 1, 2019

    @HansMuller
    Contributor

    This appears to be the same bug as #27334

  8. msw333 commented on Mar 1, 2019

    @msw333
    Author

    Great - thanks for keeping us up to date 👍.

  9. xster commented on Mar 1, 2019

    @xster
    Member

    I would remove the today tag since the issue has been there for 2 years and isn't that easily producible.

  10. HansMuller commented on Mar 1, 2019

    @HansMuller
    Contributor

    @xster I've removed the TODAY label even though I've seen you reproduce the bug with just one try 🥇

  11. Thomson-Tsui commented on Mar 2, 2019

    @Thomson-Tsui

    I met this trouble too. the application will crash on iPhone6.

  12. github-actions commented on Aug 30, 2021

    @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.

  13. locked as resolved and limited conversation to collaborators on Aug 30, 2021
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

    c: regressionIt was better in the past than it is nowf: routesNavigator, Router, and related APIs.p: cupertino_uicupertino_ui package in flutter/packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions