Skip to content

Fix Duplication of Entries in Pagination #803

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

Merged
merged 2 commits into from
Jun 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions simvue/api/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,17 @@ def get_paginated(
server response
"""
_offset: int = offset or 0

# Restrict the number of entries retrieved to be paginated,
# if the count requested is below page limit use this value
# else if undefined or greater than the page limit use the limit
_request_count: int = min(count or MAX_ENTRIES_PER_PAGE, MAX_ENTRIES_PER_PAGE)

while (
_response := get(
url=url,
headers=headers,
params=(params or {})
| {"count": count or MAX_ENTRIES_PER_PAGE, "start": _offset},
params=(params or {}) | {"count": _request_count, "start": _offset},
timeout=timeout,
json=json,
)
Expand Down
Loading