Skip to content
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

fetch and fetchArray consistently taking upwards of 2s #393

Open
2 of 7 tasks
nickpappas-underdogfantasy opened this issue Feb 26, 2024 · 0 comments
Open
2 of 7 tasks

Comments

@nickpappas-underdogfantasy
Copy link

nickpappas-underdogfantasy commented Feb 26, 2024

  • contentful.swift version number: 5.5.7
  • Xcode version number: Xcode 15.2
  • Target operating system(s) and version number(s)
    • iOS:
    • tvOS:
    • watchOS:
    • macOS:
  • Package manager:
    • Carthage
    • Cocoapods
    • SPM

We are noticing that fetch and fetchArray are taking between 1.5-2.5s on average when trying to fetch an entry by ID. Per network logs, it looks like the response comes back super quick, but hangs in the SDK for 1-2s. This seems to be isolated to iOS as Android is using the exact same entry and only experiencing 200-300ms response time from their equivalent SDK method (.one).

Please let me know if we are doing something wrong here:

        let content: PromoModel = try await withCheckedThrowingContinuation { continuation in
            client.fetch(PromoModel.self, id: Content.homepageBanners.id) { result in
                switch result {
                case .success(let promos):
                    continuation.resume(returning: promos)
                case .failure(let error):
                    continuation.resume(throwing: error)
                }
            }
        }

I have start and end times captured before and after this fetch and have isolated the wait to be here.

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

No branches or pull requests

1 participant