Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When installing an extension that has an undefined displayName the extensions section gets broken #2871

Closed
lstocchi opened this issue Jun 15, 2023 · 6 comments · Fixed by #4380
Assignees
Labels
area/dashboard 📊 Concern the dashboard from Container Desktop kind/bug 🐞 Something isn't working
Milestone

Comments

@lstocchi
Copy link
Contributor

Bug description

If an extension does not have a display name the extensions section is broken.

extension-tree-broken

It fails at

export async function fetchExtensions() {
  const result = await window.listExtensions();
  result.sort((a, b) => a.displayName.localeCompare(b.displayName));
  extensionInfos.set(result);
}

Operating system

Windows 11

Installation Method

None

Version

next (development version)

Steps to reproduce

  1. install quay.io/lstocchi/sample-podman-extension:v1
  2. check that your extensions section is broken

Relevant log output

No response

Additional context

No response

@lstocchi lstocchi added the kind/bug 🐞 Something isn't working label Jun 15, 2023
@deboer-tim deboer-tim self-assigned this Jun 15, 2023
@benoitf benoitf added area/dashboard 📊 Concern the dashboard from Container Desktop and removed status/need-triage labels Jun 15, 2023
@benoitf
Copy link
Collaborator

benoitf commented Jun 15, 2023

maybe we should prevent the loading of the extension (or the installation)

@deboer-tim
Copy link
Collaborator

I was just going to give extensions a default name like "Unknown", and maybe a description too b/c the UI looks odd. But yes, we could refuse to install extensions unless they have a default set of configuration. Maybe name/displayName/description/version/publisher?

@lstocchi
Copy link
Contributor Author

Yeah better, another problem was that i could not stop/remove the extension. And i guess it was due to another missing property.

@benoitf
Copy link
Collaborator

benoitf commented Jun 15, 2023

yes, let's avoid any unexpected behaviour. Fail fast (no load or install)

@benoitf
Copy link
Collaborator

benoitf commented Jun 15, 2023

created also #2880

@deboer-tim
Copy link
Collaborator

Stopping extension install when there are missing attributes: easy, 1 min. UI gives no feedback if the install fails: may take slightly longer. :)

deboer-tim added a commit to deboer-tim/desktop that referenced this issue Jun 23, 2023
This changes analyzeExtension() to reject the Promise if there is an error
loading an extension (no manifest or missing required attributes), instead
of returning undefined. The main reason for the change is to allow error
messages to be propagated back to the client (e.g. UI).

The remaining changes are handling this in all the places that call
analyzeExtension(). IMHO most are more readable and handle error cases
cleaner after this change, but for lines 267/272/286 I tried several
options and couldn't find anything better than adding
'.catch(() => undefined))).'

Fixes containers#2871.

Signed-off-by: Tim deBoer <git@tdeboer.ca>
@nichjones1 nichjones1 added this to the 1.6.0 milestone Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard 📊 Concern the dashboard from Container Desktop kind/bug 🐞 Something isn't working
Projects
Archived in project
5 participants