-
Notifications
You must be signed in to change notification settings - Fork 389
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
[r/boards] initialize pagination #3200
Comments
@salmad3 I believe this issue is not valid anymore, requirements changed so now boards are not listed and threads are listed but in a top ranking. The top ranking of threads might need pagination but if so that could maybe be part of the ranking issue or a completely separate one. |
@jeronimoalbi description updated to reflect the latest criteria. |
[08-01-2025]: We settled on having basic pagination in the first version. Without it, any spam or large data sets (e.g., many comments in a thread) could render a page non-functional.
|
Implement pagination for boards, threads and replies. Closes #3200, #3539 CC @jeronimoalbi @salmad3
Context
Proper pagination ensures the boards realm doesn’t become unresponsive or generate excessively large responses. By limiting how many threads or comments are retrieved in each call, we avoid performance bottlenecks and potential denial-of-service via spammy or long-running queries. Pagination also provides a structured way for clients to navigate large lists of threads and comments.
It is a viable path to adapt the avl pager. If not, we'll have to implement our own.
Acceptance Criteria
Configurable Page Size
ThreadPageSize
andCommentPageSize
inBoardsRealmConfig
, with default values (e.g., 10 or 20).Pagination Functions
ListThreads(boardName string, page int) []Thread
to retrieve a slice of threads for the given board:page >= 1
; returns an error or empty slice if out-of-bounds.ThreadPageSize
to calculate the starting offset.ThreadPageSize
threads, sorted by creation time or a default ordering.ListComments(threadID string, page int) []Comment
to retrieve comments for a thread, similarly respectingCommentPageSize
and default sort order (chronological or otherwise).Example
Permission Checks (Optional)
Hidden Posts
Consistency for Large Data
Tests
pageSize
items.Notes
ThreadPageSize
andCommentPageSize
.The text was updated successfully, but these errors were encountered: