-
Notifications
You must be signed in to change notification settings - Fork 221
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
[bug]: search client is permanently broken if initialized without network connectivity #1568
Comments
Hey, does this also happen with v5? I assume the requests are cached and answers automatically |
Stopped using v5 due to issues we ran into. #1554 Why would failures be cached? I tried to reset the transporter & cache/ recreate the serchclient and initIndex again as well
|
Hey @giantslogik 👋🏻 I guess you're customising the timeout values somewhere else in the code? The values are in milliseconds, so could you try again after increasing them by a thousand factor, please? |
We are not setting a connection Timeout in the code. Based on your comment i modified the code to be:
The log remains the same: |
The code creates multiple search clients with calls to Based on observation i suspect it returns the same immutable (and in this case broken) singleton instance each time. |
@giantslogik I'm really sorry for my mistake. It seems it's our serializer that reports a bad value for the timeouts... You can get rid of it. |
@Fluf22 I also navigated to other parts of our (React Native) Application which use Algolia either with InstantSearch or directly with |
Could you please try disabling the cache: https://www.algolia.com/doc/guides/building-search-ui/going-further/improve-performance/js/#disable-the-cache ? |
@Fluf22 disabling the cache did not help. (same error) However note that our application calls |
@shortcuts @Fluf22 I updated algoliasearch to the latest v5.12.0 . Same issue.
The error looks the same only the library version is different:
|
I edited your comment and deleted the first version in the history because there was still some api keys visible in it. Let me setup a quick repro and I'll get back to you |
@giantslogik I think this issue is not related to the API client... When I cut the network, I do get similar logs than those you shared above:
Then, I quickly enable back the network, before the second call in the catch block triggers, and I get the expected response. Maybe your issue is specific to the react-native setup? Could you try to setup a minimal code example that repro the issue, please? |
@Fluf22 I've confirmed that the network is working and other (non-algolia) APIs we use work while Algoia client continues to return "The Internet connection appears to be offline." . While it may be React native related, its related to whatever networking / caching the client uses under the hood. I will try and modify the stackblitz you shared. |
I wonder if this is related to the hostsCache? Maybe all hosts are marked as down and nothing is retried? Have you tried passing |
@Haroenv can confirm its not related to hostsCache. I'm leaning towards this being a react native + ios simulator issue. The algolia client recovers when testing using the mac os network link conditioner. It does not recover when disconnecting/reconnecting the mac os wifi of the machine running the simulator. Will update this issue after further testing. |
Description
If the search client is initialized when there is no network connectivity. It does not recover when connectivity is restored.
We re-execute the above code when connectivity is restored , however it continues to fail. We continue to get the same log output after connectivity is restored.
We get this error without a connection and then after internet connectivity is restored.
Client
Search
Version
^4.23.3
Relevant log output
The text was updated successfully, but these errors were encountered: