From: Alexander Ebert Date: Mon, 14 Nov 2022 15:15:55 +0000 (+0100) Subject: Stop injecting `forceBackgroundQueuePerform` into AJAX responses X-Git-Tag: 6.0.0_Alpha_1~721^2~5 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=130f49ad0dd10fa8870e91d726187a0ef8407b3a;p=GitHub%2FWoltLab%2FWCF.git Stop injecting `forceBackgroundQueuePerform` into AJAX responses --- diff --git a/ts/WoltLabSuite/Core/Ajax/DboAction.ts b/ts/WoltLabSuite/Core/Ajax/DboAction.ts index d3367e4c56..2f01d1dc93 100644 --- a/ts/WoltLabSuite/Core/Ajax/DboAction.ts +++ b/ts/WoltLabSuite/Core/Ajax/DboAction.ts @@ -23,7 +23,6 @@ import * as Core from "../Core"; type Payload = Record; type ResponseData = { actionName: string; - forceBackgroundQueuePerform?: boolean; objectIDs: number[]; returnValues: unknown; }; @@ -148,7 +147,7 @@ export class DboAction { throw new InvalidJson(response); } - if (response.headers.get("woltlab-background-queue-check") === "yes" || json.forceBackgroundQueuePerform) { + if (response.headers.get("woltlab-background-queue-check") === "yes") { void import("../BackgroundQueue").then((BackgroundQueue) => BackgroundQueue.invoke()); } diff --git a/ts/WoltLabSuite/Core/Ajax/Request.ts b/ts/WoltLabSuite/Core/Ajax/Request.ts index d56edf8d94..03a642d869 100644 --- a/ts/WoltLabSuite/Core/Ajax/Request.ts +++ b/ts/WoltLabSuite/Core/Ajax/Request.ts @@ -250,10 +250,7 @@ class AjaxRequest { } // force-invoke the background queue - if ( - xhr.getResponseHeader("woltlab-background-queue-check") === "yes" || - (data && data.forceBackgroundQueuePerform) - ) { + if (xhr.getResponseHeader("woltlab-background-queue-check") === "yes") { void import("../BackgroundQueue").then((backgroundQueue) => backgroundQueue.invoke()); } } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/DboAction.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/DboAction.js index 87787d915e..1a6e163ae7 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/DboAction.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/DboAction.js @@ -104,7 +104,7 @@ define(["require", "exports", "tslib", "./Error", "./Status", "../Core"], functi catch (e) { throw new Error_1.InvalidJson(response); } - if (response.headers.get("woltlab-background-queue-check") === "yes" || json.forceBackgroundQueuePerform) { + if (response.headers.get("woltlab-background-queue-check") === "yes") { void new Promise((resolve_1, reject_1) => { require(["../BackgroundQueue"], resolve_1, reject_1); }).then(tslib_1.__importStar).then((BackgroundQueue) => BackgroundQueue.invoke()); } return json.returnValues; diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js index e5357351d3..b6d3be6097 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js @@ -214,8 +214,7 @@ define(["require", "exports", "tslib", "./Status", "../Core", "../Dom/Change/Lis data.returnValues.template = data.returnValues.template.trim(); } // force-invoke the background queue - if (xhr.getResponseHeader("woltlab-background-queue-check") === "yes" || - (data && data.forceBackgroundQueuePerform)) { + if (xhr.getResponseHeader("woltlab-background-queue-check") === "yes") { void new Promise((resolve_1, reject_1) => { require(["../BackgroundQueue"], resolve_1, reject_1); }).then(tslib_1.__importStar).then((backgroundQueue) => backgroundQueue.invoke()); } } diff --git a/wcfsetup/install/files/lib/action/AJAXProxyAction.class.php b/wcfsetup/install/files/lib/action/AJAXProxyAction.class.php index fd50eba8c1..813ccf3e69 100644 --- a/wcfsetup/install/files/lib/action/AJAXProxyAction.class.php +++ b/wcfsetup/install/files/lib/action/AJAXProxyAction.class.php @@ -114,11 +114,6 @@ class AJAXProxyAction extends AJAXInvokeAction } } - // force background queue invocation - if (!\class_exists(WCFACP::class, false) && WCF::getSession()->getVar('forceBackgroundQueuePerform')) { - $this->response['forceBackgroundQueuePerform'] = true; - } - parent::sendResponse(); } }