Skip to content

Commit

Permalink
[web] Instantiate the issues proxy earlier
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
joseivanlopez committed Jan 16, 2024
1 parent df72d49 commit 4a9b7be
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions web/src/client/mixins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<Issue[]>}
*/
async getIssues() {
const proxy = await this.client.proxy(ISSUES_IFACE, object_path);
const proxy = await this.proxies.issues;
return proxy.All.map(buildIssue);
}

Expand Down Expand Up @@ -140,7 +146,7 @@ const STATUS_IFACE = "org.opensuse.Agama1.ServiceStatus";
*/

/**
* @typedef {GConstructor<{ client: import("./dbus").default }>} WithDBusClient
* @typedef {GConstructor<{ client: import("./dbus").default, proxies: ?Object }>} WithDBusClient
*/

/**
Expand Down

0 comments on commit 4a9b7be

Please sign in to comment.