Prevent race condition when tagging for deletion
Prevent race condition when tagging for deletion

Users are still reporting that intermittently when using the Page Curation toolbar to tag for AFD, the AFD page is not created. It occurs to me that their page may be refreshing (which would terminate all unfinished asyncs) before the AFD code has executed. In this patch, I save the AFD code's promise, and use $.when.apply.then (equivalent of Promise.all) to ensure that everything is executed before proceeding to the code that refreshes the page.

Bug: T238025
Change-Id: I139aa4f622fed37d2f12b771fa21ab275c4c555c

wikimedia/mediawiki-extensions-PageTriage,wikimedia/mediawiki-extensions-PageTriage,wikimedia/mediawiki-extensions-PageTriage