-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
feat: add cursor pagination support on sync messages #33810
feat: add cursor pagination support on sync messages #33810
Conversation
🦋 Changeset detectedLatest commit: 3921018 The changes in this PR will be included in the next version bump. This PR includes changesets to release 35 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Looks like this PR is ready to merge! 🎉 |
1ee2ef8
to
3f3d255
Compare
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #33810 +/- ##
===========================================
- Coverage 75.18% 75.16% -0.03%
===========================================
Files 495 497 +2
Lines 21600 21688 +88
Branches 5362 5392 +30
===========================================
+ Hits 16241 16301 +60
- Misses 4717 4743 +26
- Partials 642 644 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a changeset?
Co-authored-by: Marcos Spessatto Defendi <[email protected]>
As per CORE-686 and CORE-682, this PR introduces cursor pagination to the messages/get Meteor method route, which supports the
chat.syncMessages
route. This improvement allows users to retrieve updates from a given date more efficiently, without compromising response times.While cursor pagination is now available, it does not affect any existing behaviors. To use cursor pagination, instead of passing
lastUpdate
as query parameter, users will need to passnext
orprevious
, along withcount
andtype
.next
orprevious
: These represent the cursor pointers indicating whether the query should retrieve items from a later or earlier point in time. The cursor value must be the number of milliseconds, as it follows Date getTime().count
: Specifies the number of records to return.type
: With the introduction of cursors, both updated and deleted messages cannot be retrieved in the same response. Users must specify whether they want to retrieveDELETED
(for deleted messages) orUPDATED
(for updated messages, which is the default use case).Notes:
lastUpdate
will continue to have the same experience, with no changes required on their end.Edit: As per OPI-53, it adds cursor null conditions when there's no more records to fetch.