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

Fix account search always returning exact match on paginated results #11525

Merged
merged 1 commit into from
Aug 11, 2019

Conversation

Gargron
Copy link
Member

@Gargron Gargron commented Aug 8, 2019

Fix #11365

@Gargron Gargron added the bug Something isn't working label Aug 8, 2019
@ClearlyClaire
Copy link
Contributor

Won't the first request return up to limit + 1 results, and clients would have to use that as offset, but that would skip one database result? And later down the line, the exact match could appear a second time

@Gargron
Copy link
Member Author

Gargron commented Aug 10, 2019

Okay, first request should now return exactly limit results. To fix the exact match possibly re-appearing later, the account search query methods need to refactored to be composable.

@Gargron Gargron merged commit c5661b0 into master Aug 11, 2019
@Gargron Gargron deleted the fix-11365 branch August 11, 2019 11:14
@ClearlyClaire
Copy link
Contributor

I think this still skips the first result of the second pagination page? Say limit is 3, with one exact match, the service would return, for the first query: the exact match and 2 other results (results 0 and 1 from SQL)

when performing a second query, the client would use an offset of 3, that would return results 3 and 4 from the SQL query, missing the second one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/api/v2/search will always return ones own account, no matter the offset
3 participants