tursodatabase / tursodatabase/libsql-client-ts

Panic after enabling embedded replica when using named placeholders

Open
#232 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

app-1          | thread '<unnamed>' panicked at src/statement.rs:340:62:
app-1          | called `Option::unwrap()` on a `None` value
app-1          | stack backtrace:
app-1          |    0:     0x7f4b06c5b439 - <unknown>
app-1          |    1:     0x7f4b06920400 - <unknown>
app-1          |    2:     0x7f4b06c30e12 - <unknown>
app-1          |    3:     0x7f4b06c5cd9e - <unknown>
app-1          |    4:     0x7f4b06c5c520 - <unknown>
app-1          |    5:     0x7f4b06c5d6e7 - <unknown>
app-1          |    6:     0x7f4b06c5d0b8 - <unknown>
app-1          |    7:     0x7f4b06c5d046 - <unknown>
app-1          |    8:     0x7f4b06c5d033 - <unknown>
app-1          |    9:     0x7f4b06894cb4 - <unknown>
app-1          |   10:     0x7f4b06894e82 - <unknown>
app-1          |   11:     0x7f4b06895245 - <unknown>
app-1          |   12:     0x7f4b069156f0 - <unknown>
app-1          |   13:     0x7f4b068dfa2b - <unknown>
app-1          |   14:           0xc51049 - _ZN6v8impl12_GLOBAL__N_123FunctionCallbackWrapper6InvokeERKN2v820FunctionCallbackInfoINS2_5ValueEEE
app-1          |   15:           0xf57eaf - _ZN2v88internal25FunctionCallbackArguments4CallENS0_15CallHandlerInfoE
app-1          |   16:           0xf5871d - _ZN2v88internal12_GLOBAL__N_119HandleApiCallHelperILb0EEENS0_11MaybeHandleINS0_6ObjectEEEPNS0_7IsolateENS0_6HandleINS0_10HeapObjectEEENS8_INS0_20FunctionTemplateInfoEEENS8_IS4_EEPmi
app-1          |   17:           0xf58be5 - _ZN2v88internal21Builtin_HandleApiCallEiPmPNS0_7IsolateE
app-1          |   18:          0x1963df6 - Builtins_CEntry_Return1_ArgvOnStack_BuiltinExit

const dbClient = libsqlClient.createClient({
  url: conf.EVENT_DB_URL,
  syncUrl: conf.EVENT_DB_SYNC_URL,
  authToken: conf.EVENT_DB_SYNC_TOKEN,
});

Everything works fine when the client has no syncUrl and uses EVENT_DB_SYNC_URL for the url.

Using @libsql/client 0.7

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

Reproduce the failure with the TypeScript client configured with both url and syncUrl, using named placeholders, and compare it with the working configuration without syncUrl. Start at src/statement.rs:340:62, then verify that the named-placeholder query no longer panics when embedded replica sync is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
sqlite, typescript
Domain
api, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.