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

API Error Response Overhaul #1526

Closed
clpetersonucf opened this issue Oct 18, 2023 · 1 comment
Closed

API Error Response Overhaul #1526

clpetersonucf opened this issue Oct 18, 2023 · 1 comment
Assignees

Comments

@clpetersonucf
Copy link
Member

Many API endpoints return a boilerplate error message if certain conditions aren't met, chiefly whether the current user is logged in and their session is valid. These are largely producing responses in the form of Msg::no_login(), which returns a seemingly successful response with an error message - yuck.

Unfortunately, a lot of our recent tooling of the front-end means these API responses aren't being handled appropriately. Ideally, an error response performs the following:

  1. Returns an appropriate response code (not 200!)
  2. Unloads and destroys the session, if it wasn't done so already and the action is appropriate (e.g., no login)
  3. Returns an appropriate response message

#1525 already begins the work of better handling invalidLogin states but other parts of the front-end do not behave well when a seemingly successful API response doesn't actually include expected payload data, like any React Query onError hooks.

@clpetersonucf
Copy link
Member Author

Completed in #1547 as part of 10.2.0 💪

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

No branches or pull requests

2 participants