AvdLee / appstoreconnect-swift-sdk

The Swift SDK to work with the App Store Connect API from Apple.
Other
1.48k stars 198 forks source link

Paged request `APIEndpoint.v1.users.get` returns duplicates and is missing data #291

Open ashton-seek opened 2 weeks ago

ashton-seek commented 2 weeks ago

Not sure if the API is at fault or the paging implementation here.

My request is simple:

let userRequest = APIEndpoint.v1.users.get(
      parameters: .init(
         filterUsername: email,
        filterRoles: role
    )
)

for try await page in provider.paged(userRequest) {
    for user in page.data {
        print(user.attributes?.username ?? "<nil>")
    }
}

But I get different results running this again and again, some users are printed twice, and some are missing. There are between 70-110 users in the accounts I'm querying.