Bug 1868249 - Allow pending gecko results to be resolves when canceling an add-on installation. r=willdurand

Differential Revision: https://phabricator.services.mozilla.com/D196353
This commit is contained in:
Arturo Mejia 2024-02-04 18:23:43 +00:00
Родитель 7e4bfc3692
Коммит 26dd94a024
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -424,8 +424,15 @@ class ExtensionInstallListener {
try {
this.install.cancel();
cancelled = true;
} catch (_) {
} catch (ex) {
// install may have already failed or been cancelled
debug`Unable to cancel the install installId ${installId}, Error: ${ex}`;
// When we attempt to cancel an install but the cancellation fails for
// some reasons (e.g., because it is too late), we need to revert this
// boolean property to allow another cancellation to be possible.
// Otherwise, events like `onDownloadCancelled` won't resolve and that
// will cause problems in the embedder.
this.cancelling = false;
}
aCallback.onSuccess({ cancelled });
break;