Skip to content

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

Merged
Gargron merged 1 commit intomasterfrom
fix-11365
Aug 11, 2019
Merged

Fix account search always returning exact match on paginated results#11525
Gargron merged 1 commit intomasterfrom
fix-11365

Conversation

@Gargron
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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