From cebff25b282b2fcfdcb88e573b624abd09936507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Iv=C3=A1n=20L=C3=B3pez=20Gonz=C3=A1lez?= Date: Tue, 16 Jan 2024 14:37:29 +0000 Subject: [PATCH] [web] Instantiate the issues proxy earlier - For some reason, creating a proxy for issues fails. - This same error has already been detected with other proxies, for example for the storage manager interface. - Anticipating the creation of the proxies fixes the issue. - Further research is needed to understand what happens at cockpit level. --- web/src/client/mixins.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/client/mixins.js b/web/src/client/mixins.js index 78f5618b8c..436bab8315 100644 --- a/web/src/client/mixins.js +++ b/web/src/client/mixins.js @@ -75,13 +75,19 @@ const buildIssue = (dbusIssue) => { * @template {!WithDBusClient} T */ const WithIssues = (superclass, object_path) => class extends superclass { + constructor(...args) { + super(...args); + this.proxies ||= {}; + this.proxies.issues = this.client.proxy(ISSUES_IFACE, object_path); + } + /** * Returns the issues * * @return {Promise} */ async getIssues() { - const proxy = await this.client.proxy(ISSUES_IFACE, object_path); + const proxy = await this.proxies.issues; return proxy.All.map(buildIssue); }