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 Returns 200 OK Status for Non-Existent Task Instead of 404 Not Found #2290

Closed
6 of 10 tasks
AnujChhikara opened this issue Dec 7, 2024 · 4 comments · Fixed by #2296
Closed
6 of 10 tasks

API Returns 200 OK Status for Non-Existent Task Instead of 404 Not Found #2290

AnujChhikara opened this issue Dec 7, 2024 · 4 comments · Fixed by #2296

Comments

@AnujChhikara
Copy link
Contributor

Issue Description

The backend API https://api.realdevsquad.com/taskRequests/:id returning a 200 OK status code along with the message "Task request returned successfully" even when the requested task ID does not exist. This is misleading because it suggests the request was successful, while the task is not actually found.

Expected Behavior

  • The API should return a 404 Not Found status code.
  • The response body should provide a clear error message, such as:
{
    "error": "Task not found"
}

The message "Task request returned successfully" should only be returned when a valid task is found.

Current Behavior

  • The API returns a 200 OK status code, regardless of whether the task ID exists or not.
  • The response body always includes:
{
    "message": "Task request returned successfully"
}

Screenshots

Reproducibility

  • This issue is reproducible
  • This issue is not reproducible

Steps to Reproduce

  • Try sending a get request to this endpoint https://api.realdevsquad.com/taskRequests/:id with a task ID that does not exist
  • Observe that the response returns a 200 OK status code with the message "Task request returned successfully".

Severity/Priority

  • Critical
  • High
  • Medium
  • Low

Additional Information

Checklist

  • I have read and followed the project's code of conduct.
  • I have searched for similar issues before creating this one.
  • I have provided all the necessary information to understand and reproduce the issue.
  • I am willing to contribute to the resolution of this issue.
@Akshat187
Copy link
Contributor

I would like to work on this

@Akshat187
Copy link
Contributor

Akshat187 commented Dec 7, 2024

This is the issue, I have reproduced in dashboard site

Screen_Recording_2024-12-07_at_10.53.38_PM.mov

@Xundan91
Copy link

@Akshat187 Any updates?

@Akshat187
Copy link
Contributor

I'm working on this already @Xundan91

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants