From 67b2f26bd0dcb71b06ec63231d7bd44685a35a25 Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 28 Oct 2024 19:54:22 +0100 Subject: [PATCH 1/2] Simplify ConnectionI.checkState in JavaScript --- js/src/Ice/ConnectionI.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/js/src/Ice/ConnectionI.js b/js/src/Ice/ConnectionI.js index af5ebd6c39f..ecc4d5dfdef 100644 --- a/js/src/Ice/ConnectionI.js +++ b/js/src/Ice/ConnectionI.js @@ -1488,22 +1488,12 @@ export class ConnectionI { } checkState() { - if (this._state < StateHolding || this._upcallCount > 0) { - return; - } - - // - // We aren't finished until the state is finished and all - // outstanding requests are completed. Otherwise we couldn't - // guarantee that there are no outstanding calls when deactivate() - // is called on the servant locators. - // - if (this._state === StateFinished && this._finishedPromises.length > 0) { - // - // Clear the OA. See bug 1673 for the details of why this is necessary. - // - this._adapter = null; - this._finishedPromises.forEach(p => p.resolve()); + // We aren't finished until the state is finished and all outstanding requests are completed. Otherwise we + // couldn't guarantee that there are no outstanding calls when deactivate() is called on the servant locators. + if (this._state === StateFinished && this._upcallCount == 0) { + for (const p of this._finishedPromises) { + p.resolve(); + } this._finishedPromises = []; } } From f985cf84b556a8979028b08a679696a698151cc5 Mon Sep 17 00:00:00 2001 From: Jose Date: Mon, 28 Oct 2024 19:57:46 +0100 Subject: [PATCH 2/2] Fix number comparison --- js/src/Ice/ConnectionI.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/Ice/ConnectionI.js b/js/src/Ice/ConnectionI.js index ecc4d5dfdef..a2d293df904 100644 --- a/js/src/Ice/ConnectionI.js +++ b/js/src/Ice/ConnectionI.js @@ -1490,7 +1490,7 @@ export class ConnectionI { checkState() { // We aren't finished until the state is finished and all outstanding requests are completed. Otherwise we // couldn't guarantee that there are no outstanding calls when deactivate() is called on the servant locators. - if (this._state === StateFinished && this._upcallCount == 0) { + if (this._state === StateFinished && this._upcallCount === 0) { for (const p of this._finishedPromises) { p.resolve(); }