tursodatabase / tursodatabase/libsql-client-ts

`createClient` using embedded replica blocks on I/O

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

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
576
Forks
69
PR merge metrics
No merged PRs in 30d

Description

createClient should not block the caller at all, nor throw errors unrelated to the validity of the parameters it receives. An example of a thrown error can be seen in #98.

Seems related to https://github.com/libsql/libsql-js/issues/22

Instead, the SDK should try to connect asynchronously after client creation, and defer any errors to first async method call on the client. Either that, or there should be a new client factory function that returns a promise instead of a client object and operates entirely async.

Contributor guide

Open the contributing guide

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 reading the createClient implementation and reproduce the synchronous failure described in issue #98. Review the related libsql issue #22 for context. Done means client creation performs no blocking I/O or unrelated synchronous throws, with connection errors deferred to the first asynchronous client method or handled by an asynchronous factory.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.