algolia / algolia/algoliasearch-client-javascript

[bug]: search client is permanently broken if initialized without network connectivity

Offen
#1,568 15 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug external more info needed
Vorherrschende Sprache
TypeScript
Sterne
1.4k
Forks
227
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Description

If the search client is initialized when there is no network connectivity. It does not recover when connectivity is restored.
```
const searchClient = algoliasearch('algoliaAppId' , ‘algoliaApiKey’);

const sgAlgoliaIndex = searchClient.initIndex('indexname');

sgAlgoliaIndex.browseObjects…..
```
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

```shell
{"name":"RetryError","message":"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.","transporterStackTrace":[{"request":{"data":"{\"query\":\"\",\"filters\":\"REMOVED",\"attributesToRetrieve\":[\"REMOVED\"]}","headers":{"x-algolia-api-key":"*****","x-algolia-application-id":"REMOVED","content-type":"application/x-www-form-urlencoded"},"method":"POST","url":"https://REMOVED-dsn.algolia.net/1/indexes/superGroups/browse?x-algolia-agent=Algolia%20for%20JavaScript%20(4.23.3)%3B%20Browser","connectTimeout":1,"responseTimeout":2},"response":{"content":"The Internet connection appears to be offline.","status":0,"isTimedOut":false},"host":{"protocol":"https","url":"REMOVED-dsn.algolia.net","accept":1},"triesLeft":3},{"request":{"data":"{\"query\":\"\",\"filters\":\"REMOVED",\"attributesToRetrieve\":[\"REMOVED\"]}","headers":{"x-algolia-api-key":"*****","x-algolia-application-id":"REMOVED","content-type":"application/x-www-form-urlencoded"},"method":"POST","url":"https://REMOVED-3.algolianet.com/1/indexes/superGroups/browse?x-algolia-agent=Algolia%20for%20JavaScript%20(4.23.3)%3B%20Browser","connectTimeout":1,"responseTimeout":2},"response":{"content":"The Internet connection appears to be offline.","status":0,"isTimedOut":false},"host":{"protocol":"https","url":"REMOVED-3.algolianet.com","accept":3},"triesLeft":2},{"request":{"data":"{\"query\":\"\",\"filters\":\"REMOVED\",\"attributesToRetrieve\":[\"REMOVED\"]}","headers":{"x-algolia-api-key":"*****","x-algolia-application-id":"REMOVED","content-type":"application/x-www-form-urlencoded"},"method":"POST","url":"https://REMOVED-1.algolianet.com/1/indexes/superGroups/browse?x-algolia-agent=Algolia%20for%20JavaScript%20(4.23.3)%3B%20Browser","connectTimeout":1,"responseTimeout":2},"response":{"content":"The Internet connection appears to be offline.","status":0,"isTimedOut":false},"host":{"protocol":"https","url":"REMOVED-1.algolianet.com","accept":3},"triesLeft":1},{"request":{"data":"{\"query\":\"\",\"filters\":\"type.type:Public AND NOT monetized:true AND summary.totalPosts>0\",\"attributesToRetrieve\":[\"publicId\"]}","headers":{"x-algolia-api-key":"*****","x-algolia-application-id":"REMOVED","content-type":"application/x-www-form-urlencoded"},"method":"POST","url":"https://REMOVED-2.algolianet.com/1/indexes/superGroups/browse?x-algolia-agent=Algolia%20for%20JavaScript%20(4.23.3)%3B%20Browser","connectTimeout":1,"responseTimeout":2},"response":{"content":"The Internet connection appears to be offline.","status":0,"isTimedOut":false},"host":{"protocol":"https","url":"REMOVED-2.algolianet.com","accept":3},"triesLeft":0}]}
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne bei der Initialisierung von algoliasearch und dem Anfragepfad von initIndex/browseObjects und verfolge dann, wie fehlgeschlagene Hosts und Wiederholungsversuche nach der ersten Offline-Anfrage beibehalten werden. Reproduziere die im Bericht beschriebene Sequenz und füge eine Regressionstestabdeckung hinzu, die zeigt, dass eine Browse-Anfrage nach der Wiederherstellung der Verbindung erfolgreich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
api, search
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.