Skip to content

Conversation

@neekolas
Copy link
Contributor

@neekolas neekolas commented Sep 3, 2025

Add pagination documentation for the chat app conversation list to guide list retrieval behavior

Update list.mdx to document conversation list pagination and correct Swift examples. The changes include:

  • Add a "Paginate the conversation list" section describing limit with createdAtNs or lastActivityNs, default sort behavior, and instability warnings when sorting by lastActivityNs.
  • Add Kotlin examples for paginating by last activity using lastActivityBeforeNs and by creation time using createdAtBeforeNs with orderBy = CREATED_AT.
  • Add Swift examples for the same patterns using lastActivityBeforeNs/lastActivityAtNs and createdAtBeforeNs/createdAtNs with appropriate orderBy.
  • Remove await from Swift calls to client.conversations.listDms(consentState: .allowed) and client.conversations.listGroups(consentState: .allowed).
  • Add placeholder TypeScript code-group blocks for Browser, Node, and React Native.

📍Where to Start

Start with the new pagination section and code examples in list.mdx.


Macroscope summarized 2356c30.

@vercel
Copy link

vercel bot commented Sep 3, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-xmtp-org Ready Ready Preview Comment Nov 11, 2025 0:11am

Copy link
Contributor Author

neekolas commented Sep 3, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@neekolas neekolas force-pushed the 09-03-add_docs_around_pagination_of_the_conversation_list branch from fae3998 to a05d974 Compare September 3, 2025 20:23
@jhaaaa jhaaaa marked this pull request as ready for review September 26, 2025 15:59
@jhaaaa jhaaaa requested a review from a team as a code owner September 26, 2025 15:59

Apps should only sort conversations by `lastActivityNs` when paginating if they expect not to receive new messages in the conversations unexpectedly (apps that don't utilize streaming), or where the page size is very large and missed conversations are acceptable.

To paginate against a stably sorted list you should use the `createdAtBeforeNs` parameter for filtering and an `orderBy` of `createdAt`, and perform the final sort of conversations in your app.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now createdBeforeNs

@macroscopeapp
Copy link

macroscopeapp bot commented Nov 5, 2025

Document conversation list pagination and update Swift DM/group examples in list.mdx to show limit with createdAtNs/lastActivityNs and remove await from Client.conversations.listDms and Client.conversations.listGroups

Add pagination guidance with limit plus createdAtNs or lastActivityNs, include cross-platform code for created-at paging, note last-activity paging edge case, and adjust Swift DM/group snippets to drop await.

📍Where to Start

Start with the pagination sections in list.mdx, focusing on the new created-at and last-activity examples and the Swift code changes.


Macroscope summarized fdb25d6.

Copy link
Collaborator

@jhaaaa jhaaaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed with Nick. Good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants