From be0581337609cb54cc7d70cb2d29654d0add8ad4 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Wed, 17 Apr 2024 15:15:39 -0700 Subject: [PATCH] Bump consent pagination (#316) * bump the consent page to 500 * fix up some syntax * bump the pod * dont need to bump this cause ethan did --- Sources/XMTPiOS/ApiClient.swift | 2 +- Sources/XMTPiOS/Contacts.swift | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/XMTPiOS/ApiClient.swift b/Sources/XMTPiOS/ApiClient.swift index 297c1dd1..ab5a184c 100644 --- a/Sources/XMTPiOS/ApiClient.swift +++ b/Sources/XMTPiOS/ApiClient.swift @@ -141,7 +141,7 @@ final class GRPCApiClient: ApiClient { cursor = response.pagingInfo.cursor hasNextPage = !response.envelopes.isEmpty && response.pagingInfo.hasCursor - if let limit = pagination?.limit, envelopes.count >= limit { + if let limit = pagination?.limit, envelopes.count >= limit, limit <= 100 { envelopes = Array(envelopes.prefix(limit)) break } diff --git a/Sources/XMTPiOS/Contacts.swift b/Sources/XMTPiOS/Contacts.swift index 8376c937..924d2840 100644 --- a/Sources/XMTPiOS/Contacts.swift +++ b/Sources/XMTPiOS/Contacts.swift @@ -74,6 +74,7 @@ public class ConsentList { let newDate = Date() let pagination = Pagination( + limit: 500, after: lastFetched, direction: .ascending )