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
refactor: optimize totalCount compute for X-Total-Count header #139
Conversation
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
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.
@ricfio LGTM, just please make sure that we have a test for this case
I tried adding some extra tests, but he was sure it was a good idea, so I preferred not to add them right now. If you want I could add these:
|
Add them ;) |
@@ -311,13 +311,6 @@ test('list', async ({ pass, teardown, same, equal }) => { | |||
}).slice(2), `${url} response`) | |||
} | |||
|
|||
{ |
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 added after the test /posts?totalCount=true
(temporarly removed) in other position with a later commit.
please see the changes history commit by commit because I have done some tests refactor before the last commit:
|
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.
OK!
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
computes
totalCount
without extra query execution when possible