-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
Better documetnation needed for paginateEventTimeline
#3001
Comments
Ok, I found that I MUST to define the opts But this don't give me a paginated list, this instead do same as What I would like to do is to retrieve a paginated list of events, like from 0 to 10th, from 10th to 20th etc.. The only way to achieve this with the sdk is to add events to the timeline? Thanks in advance |
@selankon I had some issues with pagination myself, so I used the scrollback helper to get previous messages and then updated the UI state myself. Let me know if that help.
|
Hi, thanks for your answer. This is how finally I resolve the problem but it don't paginate, just add events to the live event timeline. I adapted my program to this behaviour |
@selankon It's not ideal but It let's us emulate the same behavior as pagination, that otherwise can be handled by sdk itself but due to lack of support and documentation it makes it very difficult to achieve the small niches. |
There are no examples of how to do this correctly and a lot of bad information out there so I figured it out and wanted to share for others. To paginate I highly recommend using the TimelineWindow class. That is the whole purpose of this class. You have to initialize it yourself.
Since this uses the default unfiltered timeline it will have the initial sync limit from MatrixClient's
I was trying a page size of 20 but my initialSyncLimit was set to the default |
paginateEventTimeline
[contributions to documentation improvements are very welcome!] |
@skylord123 thank you very much! Great example. |
@skylord123 how can we work with the |
@theobouwman New matrix events emit an event on the matrix client when they come in. You listen for this event to handle incoming matrix events. My package node-red-contrib-matrix-chat for Node-RED uses this so you can check it out for reference: As far as I am aware the event timeline is only used to paginate events that have already occurred (so more for paginating past events). I may be wrong about that though. I would definitely contribute to the docs if I was more sure about my findings. For now though if anyone needs an example of how to paginate I created a node to do exactly this for my module so that code can be used as a reference: |
Hi,
I need help to use the
paginateEventTimeline
method. I don't find documentation anywhere.From a room of type
sdk.Room
i'm trying to get paginated events:But this fail with error:
Can anyone give me instructions of how to get paginated room events?
Thanks in adavance!
The text was updated successfully, but these errors were encountered: