tursodatabase / tursodatabase/libsql-client-ts
Long-lived client object can cause "invalid baton" errors
Open
Nobody has claimed this yet.
bug
- Dominant language
- TypeScript
- Stars
- 576
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description
If you have a long-lived client object, the server can start complaining about the baton:
LibsqlError: SERVER_ERROR: Server returned HTTP status 400: Received an invalid baton
at (node_modules/@libsql/client/lib-esm/hrana.js:257:15)
at (node_modules/@libsql/client/lib-esm/hrana.js:182:36)
at (node_modules/@libsql/client/lib-esm/hrana.js:184:12)
at (node_modules/drizzle-orm/libsql/index.mjs:38:12)
at (node_modules/next/dist/esm/server/future/route-modules/app-route/module.js:210:36) {
code: 'SERVER_ERROR',
rawCode: undefined,
name: 'LibsqlError'
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported failure locations in node_modules/@libsql/client/lib-esm/hrana.js at lines 182 and 257, then reproduce the error with a long-lived client object. Trace how the baton is handled around that failure; done means the reported scenario no longer returns an invalid baton and is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100