Skip to content

[go_router] push future does not complete if popping shellroute #147196

Closed
flutter/packages
#6596

Description

@chunhtai

This is blocking internal package roll
https://critique.corp.google.com/cl/626191458

Steps to reproduce

This test should pass

    testWidgets('can complete leaf route', (WidgetTester tester) async {
      Future<bool?>? routeFuture;
      final List<RouteBase> routes = <RouteBase>[
        GoRoute(
          path: '/',
          builder: (BuildContext context, GoRouterState state) {
            return Scaffold(
              body: TextButton(
                onPressed: () async {
                  routeFuture = context.push<bool>('/a');
                },
                child: const Text('press'),
              ),
            );
          },
        ),
        ShellRoute(
          builder: (BuildContext context, GoRouterState state, Widget child) {
            return Scaffold(
              body: child,
            );
          },
          routes: <RouteBase>[
            GoRoute(
              path: '/a',
              builder: (BuildContext context, GoRouterState state) {
                return const Scaffold(
                  body: Text('Screen A'),
                );
              },
            ),
          ],
        ),
      ];

      final GoRouter router = await createRouter(routes, tester);
      expect(find.text('press'), findsOneWidget);

      await tester.tap(find.text('press'));
      await tester.pumpAndSettle();
      expect(find.text('Screen A'), findsOneWidget);

      router.pop<bool>(true);
      final bool? result = await routeFuture;
      expect(result, isTrue);
    });

Expected results

test pass

Actual results

test hangs

Activity

  1. self-assigned this
    on Apr 23, 2024
  2. github-actions commented on May 8, 2024

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

  3. locked as resolved and limited conversation to collaborators on May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: regressionIt was better in the past than it is now

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions