Repository navigation
fix: stop treating an empty error string as an error result - #2128
Conversation
There was a problem hiding this comment.
🟡 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
isErrorto no longer treat an emptyerrorstring as an error. - Update server aggregation behavior to omit
success/errorfields 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.
There was a problem hiding this comment.
🟢 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
No description provided.