Skip to content

fix: consolidating deletion logic in ExtensionService#1935

Open
gnugomez wants to merge 4 commits into
eclipse-openvsx:mainfrom
gnugomez:gnugomez/main/delete-extensions-consolidation
Open

fix: consolidating deletion logic in ExtensionService#1935
gnugomez wants to merge 4 commits into
eclipse-openvsx:mainfrom
gnugomez:gnugomez/main/delete-extensions-consolidation

Conversation

@gnugomez

@gnugomez gnugomez commented Jul 1, 2026

Copy link
Copy Markdown
Member

This PR is a followup of #1919, while consolidating the deletion logic, the race condition has also been fixed in the admin dashboard extension deletion flow.

I'm also adding the corresponding front-end changes to re-fetch the data if the error status equals to 409.

@gnugomez gnugomez requested review from autumnfound and netomi July 1, 2026 12:20
@gnugomez gnugomez force-pushed the gnugomez/main/delete-extensions-consolidation branch from f2be33b to 26a8425 Compare July 2, 2026 10:45

@autumnfound autumnfound left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall LGTM, but I haven't run the server locally to do a full test.

@netomi netomi force-pushed the gnugomez/main/delete-extensions-consolidation branch from 26a8425 to e919387 Compare July 3, 2026 19:20

search.removeSearchEntry(extension);
logs.logAction(admin, ResultJson.success("Deleted " + NamingUtil.toExtensionId(extension)));
extensions.deleteExtension(admin, extension);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we cant just call the version from the ExtensionService as this one does not take the admin role into account afaict.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So reviewing this a bit more extensions.deleteExtension(admin, extension) should not really be problematic since it only takes the user to log the action, the overload that's taking the user into account is deleteExtension(UserData user, String namespaceName, String extensionName, List<TargetPlatformVersionJson> targetVersions) since it's the only user-facing one.

This is quite confusing tho, we should rename it or even move it out to it's own service.

Comment thread server/src/main/java/org/eclipse/openvsx/admin/AdminService.java Outdated
@netomi

netomi commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

will refactor that PR a bit due to the comments I made

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants