feat(notifications): add cursor pagination for notifications endpoint - #868
Merged
greatest0fallt1me merged 2 commits intoJul 29, 2026
Conversation
|
@Ova-Klik Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Looks good — merging. Thanks for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements stable cursor-based pagination for the
/api/notificationsendpoint using the(created_at, id)cursor to ensure deterministic ordering, even under concurrent writes.Changes
Implement cursor pagination for
GET /api/notificationsUse
(created_at, id)as the pagination cursor for stable orderingPreserve existing API behavior where applicable
Add focused tests covering:
Update API documentation to describe the new pagination behavior
Ensure request validation, standardized error responses, and structured logging remain consistent with project conventions
Closes #636
summary
Offset-based pagination can produce duplicate or missing records when new notifications are created while clients are paginating. Cursor pagination using
(created_at, id)provides deterministic, stable pagination and eliminates these consistency issues.API Changes
New Query Parameters
cursor– Opaque cursor representing the last(created_at, id)pair from the previous page.limit– Number of notifications to return (existing/default limits preserved where applicable).Response
The endpoint now returns a cursor for retrieving the next page of notifications.
Testing
Checklist