Skip to content

WebAuthenicator Prevents Dialogs From Displaying #27852

Description

@Axemasta

Description

When using the web authenticator on iOS, if you attempt to display an alert on the page it will cause the thread to crash / lock up, and you will see the following message in the console

[Presentation] Attempt to present <UIAlertController: 0x10fb76200> on <SFAuthenticationViewController: 0x11829c800> (from <SFAuthenticationViewController: 0x11829c800>) whose view is not in the window hierarchy.

I believe this issue could be related to the TaskCompletionSource being set when the SFAuthenticationViewController dismiss is invoked, the VC will be being dismissed whilst I try to present my alert, hence why it does not show.

Steps to Reproduce

  • Run my reproduction app on iOS
  • Click login
  • Press continue (the alert cancel is not affected)
  • Wait for the web view to pop up
  • Close the web view

Expected Behavior

An alert is displayed to the user

Actual Behavior

Nothing happens, the code after the display alert does not complete and the thread never finished. The UI at this point has been deadlocked and can only be reset by killing the app.

deadlock.example.480.mov

Link to public reproduction project repository

https://github.com/Axemasta/MauiRepros/tree/main/src/WebAuthenticatorPresentationIssue

Version with bug

9.0.40 SR4

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS Latest

Did you find any workaround?

Adding a 2 second Task.Delay before calling the alert will prevent the deadlock from occuring

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infoarea-essentials-webauthplatform/ioss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions