Mentorship-backend: BUG: GET/users/{user_id} returns list of null users for id that doesn't exist

Created on 29 Jul 2020  ·  14Comments  ·  Source: anitab-org/mentorship-backend

Describe the bug
When a user trying to view other user's details by sending GET /users/{user_id} with user_id that does not exist, the system returns a list of null users instead of HTTP error 404 (Not Found)

To Reproduce

Steps to reproduce the behavior:

  1. Login as a user
  2. Go to GET users/{user_id} and enter a random id that does not exist in the Users table (check the database to do this)
  3. See the response with list of empty users with null ids

Expected behavior
Must return http eerror 404 Not Found and message that user does not exist

Screenshots
Screen Shot 2020-07-29 at 5 10 27 pm

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Safari
  • Version ?
Coding Bug

All 14 comments

@anitab-org/bridgeintech-maintainers . I come across this bug when I was working on the GET /users/{useer_id} api endpoint on BIT PR#99. This is a cross-project issue as BIT response will also affected on this issue.

PS to @anitab-org/coding-team. This issue is open to anyone. I personally don't have the bandwith to work on this issue atm. Just want to raise the issue. 😉

@mtreacy002 this is an amazing catch 👏 I just tried it and it really happens 🤦‍♀️ And the fix should come with a test to cover this bug

image

@isabelcosta can you assign this to me?

@isabelcosta I would like to contribute in this as a part of OSH. Can you assign this issue to me?

If available i would like to take this up...Thanks.

@saikirankv would you still like to contribute to this? Let me know and I can assign to you.

@AprameyaGupta @pallavisavant I am going off "first come first served", if I get no response I'll assign to one of you.

Be mindful that this issue is not labeled with OSH, so it's not part of it as of now.

Yes, I'm interested in this.

Yes I want to take this up... thanks

Assigning you @saikirankv
Happy coding!

@saikirankv how's the PR going?

Worked on it, some setup issue will raise PR today.

@vj-codes I have raised PR, please review.

@mtreacy002 @vj-codes What's going on with this?

Was this page helpful?
0 / 5 - 0 ratings