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

Consider making /api/config/properties return 204 No Content instead of 404 when a setting is missing/empty #9014

Open
tdonohue opened this issue Aug 4, 2023 · 0 comments
Labels
bug interface: REST API v7+ REST API for v7 and later (dspace-server-webapp module) needs discussion Ticket or PR needs discussion before it can be moved forward.

Comments

@tdonohue
Copy link
Member

tdonohue commented Aug 4, 2023

Describe the bug
This seems to quickly becoming a "frequently asked question" on mailing lists & Slack. Some seem concerned that (when watching UI requests) they sometimes see error responses (404, etc)

For example: /server/api/config/properties/google.analytics.key is requested by the UI to determine if Google Analytics is enabled or not. This returns a 404 if GA is disabled.

To Reproduce
One basic example:

  1. Do not set google.analytics.key on backend
  2. Visit the UI with your browser's DevTools open. On the Network tab you'll see the 404 above highlighted in red. The browser also lists this 404 response as an "error" in the DevTools Console.

This behavior can be confusing to sites as they may worry something is broken in the UI. But, in fact this is expected behavior when Google Analytics is disabled.

Expected behavior
We should consider whether these 404s should simply become 204. A 204 will not be seen as an error by the user's browser. But, it would also communicate to the DSpace UI that this configuration is not set or has no value on the backend.

This will require discussion, as it would need to be a documented API change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug interface: REST API v7+ REST API for v7 and later (dspace-server-webapp module) needs discussion Ticket or PR needs discussion before it can be moved forward.
Projects
Status: 👀 Needs Discussion / Analysis
Development

No branches or pull requests

1 participant