-
Notifications
You must be signed in to change notification settings - Fork 7
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
Response consistency fixes #50
base: master
Are you sure you want to change the base?
Conversation
@marc-maurer would you be willing to give this a look-see? :) Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Seems fine |
Going to tackle #53 in this as well, changing to WIP |
I realise this probably fixed my last 3 commits.... |
That's ok, I'll pull in your stuff when I get a moment to get back to this. No biggie |
You can probably just revert all 3 when trying to merge. The reason I picked up on them is we upgraded to php 7.4 and that shows errors with the nulled / broken responses |
…pull up resources by user/updates by resource; also check if listResources has any results and if the array is empty (i.e. no more results) then send a 404 instead of a plain empty array off to infinity; closes #48.
a4e1bb8
to
6fd2d73
Compare
…ft_versions; fixes #53
6fd2d73
to
8479ff8
Compare
It only took me 498 days but I have now fixed #53 and put it in this PR as originally intended. @marc-maurer If you're still available could you review this again? Nothing has really changed since your last review except for |
I will take a look later today :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had unfourtantly no chance to test the SQL Queries itself but it looks good to me.
Thank you for completing this pull request! :)
7a47544
to
297cee8
Compare
Great! Thank you Marc, I appreciate it. I'll need to take a look later and ensure I'm using strict equality where necessary. I am sure there are other areas where I am using I have made the changes you suggested |
There was a regression in #38 that caused nonexistent resources and authors to show a normal response with every field nulled out. This patch fixes that.
Furthermore, when using the
getResourcesByAuthor
,getResourceUpdates
, andlistResources
routes if you used a negative page then you would get a 404. However, if you used a page too big you would get an empty array. Also, if the user or resource did not exist (in the case of the former two routes), you would get an empty array. For all the cases you would typically get an empty array, you now get a 404.To achieve the latter part, there are two new database checks using optimized row existence queries (i.e. making use of
EXISTS
, notCOUNT
).This fixes #48.
This fixes #53.