Skip to content

Conversation

@Achal1607
Copy link
Member

While fixing the label in the downloader in #379, a bug was introduced where all the download messages were showing id of the jdkType instead of the label. So, this PR aims to fix that.

@Achal1607 Achal1607 requested a review from sid-srini March 17, 2025 19:02
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 17, 2025
Copy link
Member

@sid-srini sid-srini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Achal1607.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be better to return the id as is if not found.

Suggested change
public static getJdkLabel = (id: string) => Object.values(this.JDK_TYPE).find(el=>el.id === id)?.label || "";
public static getJdkLabel = (id: string) => Object.values(this.JDK_TYPE).find(el=>el.id === id)?.label || id;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is JSON.stringify required here for a string value in the id field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No note required, it was required for the earlier object. Thanks for pointing this out.

Comment on lines 28 to 35
Copy link
Member

@sid-srini sid-srini Mar 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The labels have got swapped.

I think it may be better to use a programmatic approach like l10n.value("jdk.downloader.label."+id) which would be computed in the getJdkLabel(id) method and avoid storing the labels altogether.
The returned value from l10n.value(key) could be compared with the key and return id if not localised, i.e. return l10nValue !== key ? l10nValue : id

Copy link
Member

@sid-srini sid-srini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 . Thanks.

@Achal1607 Achal1607 merged commit a63ef81 into oracle:telemetry Mar 19, 2025
2 checks passed
@Achal1607 Achal1607 added this to the JVSC 24.1.0 milestone Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants