algolia / algoliasearch-client-swift

⚡️ A fully-featured and blazing-fast Swift API client to interact with Algolia.
MIT License
205 stars 65 forks source link

Crash in tryLaunch / hostIterator #705

Closed mxsc closed 3 years ago

mxsc commented 3 years ago

Describe the bug 🐛 In our crash reports we can see a crash caused by AlgoliaSearchClient in HTTPRequest.swift in tryLaunch more concretely this line: guard let host = hostIterator.next() [https://github.com/algolia/algoliasearch-client-swift/blob/65d8343d043c1cd9b8a0d985f325dad75c3a6805/Sources/AlgoliaSearchClient/Transport/HTTP/HTTPRequest.swift#L77](here in the repository)

To Reproduce 🔍 SInce it is coming through the Appstore crash reports, we could not manage to reproduce it

Expected behavior 💭 Should not crash

Screenshots 🖥 If applicable, add screenshots to help explain your problem.

Environment: iOS 14.2 iPhone XS

VladislavFitz commented 3 years ago

Hi @mxsc, Thank you for reporting this. We will investigate it at the earliest opportunity. Could you give more information about the frequency of this crash?

mxsc commented 3 years ago

For now we have a very small number of test users and it happened twice within one week.

mxsc commented 3 years ago

Maybe it is related but another crash happened in retryableHosts at this statement:

hosts.resetExpired(expirationDelay: hostsExpirationDelay)

in AlgoliaRetryStrategy.swift

VladislavFitz commented 3 years ago

Thank you for providing further details. I prioritise this issue and will keep you informed.

VladislavFitz commented 3 years ago

Hi @mxsc, The crash has been fixed in the version 8.4.1.

mxsc commented 3 years ago

Thanks for the quick fix!