fix: add Kubernetes port forward IPCs and events by jeffmaury · Pull Request #9505 · podman-desktop/podman-desktop (original) (raw)
So sorry, but after testing it, I provided the wrong solution:
I recommended to add the objects when sending the events as followed
this.apiSender.send('kubernetes-port-forwards-update', this.listForwards());
This is a problem because listForwards
is async! (why?)
IMO it should clearly not be async... but this is because the interface ForwardConfigStorage declare it async
We cannot just remove the promise, because we have an implementation using the async (FileBasedConfigStorage
),
Therefore we need to do the following
- this.apiSender.send('kubernetes-port-forwards-update', this.listForwards());
- this.apiSender.send('kubernetes-port-forwards-update', await this.listForwards());