From 4b6adca829ae3c7802bd8298588498950da643be Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Thu, 3 Oct 2024 16:09:27 +0800 Subject: [PATCH] properly set `enginesBooted` flag after boot callbacks have run --- addon/services/universe.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/addon/services/universe.js b/addon/services/universe.js index a09ddf9..0b30f28 100644 --- a/addon/services/universe.js +++ b/addon/services/universe.js @@ -1867,8 +1867,9 @@ export default class UniverseService extends Service.extend(Evented) { await tryBootEngine(extension); } - this.runBootCallbacks(owner); - this.enginesBooted = true; + this.runBootCallbacks(owner, () => { + this.enginesBooted = true; + }); }); } @@ -1953,8 +1954,9 @@ export default class UniverseService extends Service.extend(Evented) { await tryBootEngine(extension); } - this.runBootCallbacks(owner); - this.enginesBooted = true; + this.runBootCallbacks(owner, () => { + this.enginesBooted = true; + }); }); } @@ -2004,7 +2006,11 @@ export default class UniverseService extends Service.extend(Evented) { for (let i = 0; i < this.bootCallbacks.length; i++) { const callback = this.bootCallbacks[i]; if (typeof callback === 'function') { - callback(this, appInstance); + try { + callback(this, appInstance); + } catch (error) { + debug(`Engine Boot Callback Error: ${error.message}`); + } } }