From cc887a00f279696bf750607274d6180c6af1d0b9 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 21 Feb 2021 21:28:00 +0100 Subject: [PATCH] runOnBackend now does not automatically wait for the maxSyncId since it can easily result in infinite cycle --- src/public/app/services/frontend_script_api.js | 5 +++-- src/public/app/widgets/component.js | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/frontend_script_api.js b/src/public/app/services/frontend_script_api.js index 3edee67b1..c3b0763c2 100644 --- a/src/public/app/services/frontend_script_api.js +++ b/src/public/app/services/frontend_script_api.js @@ -166,8 +166,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain }, "script"); if (ret.success) { - // wait until all the changes done in the script has been synced to frontend before continuing - await ws.waitForEntityChangeId(ret.maxEntityChangeId); + // we used to wait for max entity change here returned from the response + // but it's too easy to end up in infinite cycle when this is triggered as a consequence of + // sync event (typically from custom widget) return ret.executionResult; } diff --git a/src/public/app/widgets/component.js b/src/public/app/widgets/component.js index 9a28e4925..c255a3eb9 100644 --- a/src/public/app/widgets/component.js +++ b/src/public/app/widgets/component.js @@ -91,7 +91,13 @@ export default class Component { console.log(`Call to ${fun.name} in ${this.componentId} took ${took}ms`); } - await utils.timeLimit(promise, 25000, `Time limit failed on ${this.constructor.name} with ${fun.name}`); + if (glob.isDev) { + await utils.timeLimit(promise, 3000, `Time limit failed on ${this.constructor.name} with ${fun.name}`); + } + else { + // cheaper and in non-dev the extra reporting is lost anyway through reload + await promise; + } return true; }