Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlertView canceledListener is set on cloned object but not on the original in _PresentAlertOperation #509

Closed
renonick87 opened this issue Oct 26, 2021 · 1 comment

Comments

@renonick87
Copy link
Contributor

Bug Report

The _PresentAlertOperation sets a listener for when an AlertView should be canceled from presenting. However the operation also clones the AlertView, but sets the listener on the cloned AlertView and not the original. So the developer's copy of the AlertView never gets the correct listener attached.

Reproduction Steps
  1. Pause the AlertManager's task queue with
screenManager._alertManager._canRunTasks = false;

This allows you to cancel an alert without it immediately presenting.
2. Try to present an alert, but cancel it immediately after.

screenManager.presentAlert(alertView, alertCompletionListener);
alertView.cancel();
  1. Restart the AlertManager's task queue.
screenManager._alertManager._canRunTasks = true;
Expected Behavior

The AlertView is not presented, and a message is logged stating that the Alert was canceled before presenting.

Observed Behavior

The AlertView is presented, and no message is logged about the Alert being canceled.

@theresalech
Copy link
Collaborator

Closed via #510

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants