-
Notifications
You must be signed in to change notification settings - Fork 423
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
no Total-Records header in GET requests. only in HEAD requests. #1931
no Total-Records header in GET requests. only in HEAD requests. #1931
Conversation
@peterbe, don't worry about the conflicts, I can do it and try to push a merge on your branch. |
I have one major question though: what do we do about our clients: https://github.com/Kinto/kinto-http.js/blob/27737b9e62df2aff6adc32523708cd7e66131282/src/base.js#L540 --> Maybe we should first release of kinto-http.js where the totalRecords is obtained via a HEAD? |
Haven't dug in yet but the base.js you pointed to is inside a function called
So, if the idea is that you use... for (const page in client.paginatedList(args)) {
...
} ...then we're fairly certain the total records is not needed or used. The pagination is done using Perhaps my brain is a bit end-of-day fried and there's a lot of mind-bending async in that code but it looks like the |
Yeah, my hypothesis is that nobody actually uses the |
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.
Appart from the count_only
in the model get_objects()
, it looks good to me!
GG! 🙌
Also, this is not a minor change from the client perspective. The totalRecords
is exposed in the result of listRecords()
in kinto-http.js for example. I think we should be very explicit about the change in the API changelog. If we say we follow semver, we should bump a major for the API version, and well....I'm not sure we're ready for that. So, at least we should be very explicit!
@@ -1,6 +1,3 @@ | |||
A ``Total-Objects`` response header indicates the total number of objects | |||
of the list (not the response, since it can be paginated). |
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.
We should probably have a _details-head-list.rst
where we mention that the header can be obtained with HEAD
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.
At a glance it looks OK. I'll defer to Mat for review on this. This PR badly needs a rebase :)
Do you mean a squash? Isn't that done with the green button when it's fully approved? Or do you mean it needs the latest and greatest of master? It's hard to remember what different projects have as best practices with active PRs and the landing protocol. |
Usually in the Kinto org we merge without squashing to keep the history and pace of the pull-request. Here we just need to fix tests I guess |
I can rebase this to get rid of unimportant small commits but keep stuff like the master merge and various others. But I don't think we're done yet :) |
No don't worry about that. |
The wacky diffs come from some mistakes I made during the painful merge I guess. |
…-do-with-total-records
@peterbe, I merged and repaired the merge :) Tests now pass. I believe what remains is:
|
@leplatrem It's a bit of a mess but check out the latest couple of commits related to documentation and whether it solves the Also, see the latest commit regarding how I broken up |
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.
Niiice!
Thanks for the hard work!
I made a few comment, the main one is about having a deprecation decorator for a method that was just introduced! Otherwise, it looks like close to the finish line :)
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.
Just some drive-by comments..
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 let you rebase/squash/do whatever you want before pressing the merge button ;)
@@ -0,0 +1,10 @@ | |||
Unlike GET requests, HEAD requests contain an additional header called ``Total-Objects`` | |||
(and ``Total-Records`` for backwards compatibility) which is a count of all objects | |||
in the collection with the current filtering. |
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.
in the resource?
I don't think there are any commits that are worthy to have to be squashed. If I do try to selectively squash some of them, I will have to go through the same merge conflicts you went through, no? |
Yeah, I'm ok with whatever ;) |
This got removed in Kinto/kinto#1931, and has been causing failing tests ever since.
Fixes #1624
If you added a new configuration setting, update thekinto.tpl
file with it.storage.get_all
when in fact it should be usingstorage.list_all
orstorage.count_all
.