weaviate / weaviate/typescript-client

Fix token refresh on unstable connections

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
101
Forks
38
Avg merge
4d 12h
Merged PRs (30d)
2

Description

On unstable connections, the token refresh can sometimes fail which can results in unauthenticated clients.

To be able to handle these situations, the client should:

  • set a default timeout for auth connections. We used 5s in the python client, this should be plenty
  • make sure that the refresh happens early enough to still be authenticated if it fails. In the python client we refresh 30s before the authentication expires.
  • catch exceptions about timeouts and immediately retry. Note that I saw timeouts and Connection errors (not sure about the names for them here)

With this we should be able to have 3-4 retries. If this is not enough, the connection is too bad.

Python PR with the changes and a test

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript client's authentication and token-refresh entry points. Use the linked Python PR and its test as the reference for a 5-second timeout, refreshing 30 seconds early, and retrying timeout or connection failures. Done means unstable connections allow several retries without leaving clients unauthenticated, with tests covering the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.