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 cebff25
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 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

0 comments on commit cebff25

Please sign in to comment.