Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Bug] DisplaySnackBarAsync does not wait for action task #1340

@Dreamescaper

Description

@Dreamescaper

Steps to Reproduce

Debug the following code, and tap on "Retry" button.

            bool invoked = false;
            var result = await page.DisplaySnackBarAsync("test", "Retry", async () =>
             {
                 await Task.Delay(3000);
                 invoked = true;
                 // Breakpoint1
             });

            // Breakpoint2

Expected Behavior

Retry action is awaited, Breakpoint2 is hit after Breakpoint1.

Actual Behavior

Retry action is not awaited, Breakpoint1 is hit after Breakpoint2.

Basic Information

  • Version with issue: 1.1.0
  • Platform Target Frameworks:
    • Android

Workaround

I did something like that:

            bool invoked = false;
            Task retryTask = null;
            var snackbarResult = await page.DisplaySnackBarAsync(text, "Retry", async () =>
            {
                async Task RetryAction()
                {
                    await Task.Delay(3000);
                    invoked = true;
                }
                retryTask = RetryAction();
                await retryTask;
            });

            if (snackbarResult)
            {
                await retryTask;
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    a/SnackbarbugSomething isn't working. Breaky break.s/unverifiedThis issue needs verification/reproduction by a team member. PRs cannot be accepted/merged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions