Skip to content

fix(search): resolve off-by-one error in pagination slicing limit - #88

Open
emre155 wants to merge 1 commit into
anxkhn:mainfrom
emre155:fix/search-pagination-limit
Open

fix(search): resolve off-by-one error in pagination slicing limit#88
emre155 wants to merge 1 commit into
anxkhn:mainfrom
emre155:fix/search-pagination-limit

Conversation

@emre155

@emre155 emre155 commented Jul 18, 2026

Copy link
Copy Markdown

Summary

Fixes an off-by-one bug in the search pagination slice logic where the endpoint returned one fewer result than the requested limit (closes #4).

Changes

  • Changed results[offset : offset + limit - 1] to results[offset : offset + limit] in app/main.py.
  • Added test_search_pagination in tests/test_search.py to cover this case.
  • Added clean_store fixture to all search tests to prevent test pollution.

Signed-off-by: emreumar emreumar@users.noreply.github.com

Signed-off-by: emreumar <emreumar@users.noreply.github.com>
@emre155
emre155 requested a review from anxkhn as a code owner July 18, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search endpoint returns one fewer result than expected (off-by-one)

2 participants