Skip to content

fix: stop treating an empty error string as an error result - #2128

Merged
netomi merged 3 commits into
mainfrom
gnugomez/main/fix-error-response-handling
Sep 2, 2026
Merged

netomi merged 3 commits into
mainfrom
gnugomez/main/fix-error-response-handling

Conversation

@gnugomez

@gnugomez gnugomez commented Sep 2, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI 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.

🟡 Changes recommended

isError can still throw on null (because typeof null === 'object'), which is reachable via sendStrictRequest() returning response.json() for successful responses.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR addresses a UI/backend contract edge case where the registry can return a successful delete result alongside an empty error string, which the web UI previously interpreted as an error.

Changes:

  • Adjust isError to no longer treat an empty error string as an error.
  • Update server aggregation behavior to omit success/error fields when there is nothing to report (avoids emitting empty strings).
  • Add/extend unit tests (webui + server) and refactor fetch stubbing helpers for reuse.
File summaries
File Description
webui/test/unit/support/fetch.ts Adds reusable fetch stubbing + JSON response helper for unit tests.
webui/test/unit/server-request.spec.ts Uses shared fetch helper and adds coverage for “success + empty error” responses.
webui/test/unit/components/extension/extension-delete-all-versions-dialog.spec.tsx New dialog test verifying empty-error success does not surface an error handler.
webui/src/extension-registry-types.ts Changes isError semantics to require a non-empty error string.
webui/CHANGELOG.md Documents the frontend fix for empty error strings being misclassified.
server/src/test/java/org/eclipse/openvsx/UserAPITest.java Updates expectations to ensure successful deletes do not include an error field.
server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java Ensures “no-op delete” responses omit both success and error fields.
server/src/main/java/org/eclipse/openvsx/ExtensionService.java Updates result aggregation to avoid setting empty success/error strings.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread webui/src/extension-registry-types.ts Resolved
@gnugomez
gnugomez marked this pull request as ready for review September 2, 2026 11:18
@gnugomez
gnugomez requested a lite review from Copilot September 2, 2026 11:18

Copilot AI 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.

🟢 Approval recommended

The behavior change is coherent across frontend and backend and is backed by targeted unit/integration tests that prevent regressions.

Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@netomi
netomi merged commit 7fbc68b into main Sep 2, 2026
6 checks passed
@netomi
netomi deleted the gnugomez/main/fix-error-response-handling branch September 2, 2026 11:44
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