tursodatabase / tursodatabase/libsql

Sync conflict error message is hard to decipher

Open
#2,001 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug developer experience offline writes
Dominant language
C
Stars
17.2k
Forks
531
Avg merge
1h 12m
Merged PRs (30d)
1

Description

If you write to local and remote database at the same time, sync sometimes gives you the following error instead of explicitly saying there's a conflict:

Error: Sync(InvalidPushFrameNoLow(8, 7))
    at Database.sync (/Users/penberg/src/tursodatabase/libsql-js/index.js:106:29)
    at Sqlite3Client.sync (file:///Users/penberg/tmp/example/node_modules/@libsql/client/lib-esm/sqlite3.js:148:41)
    at example (file:///Users/penberg/tmp/example/foo.mjs:15:14)
    at file:///Users/penberg/tmp/example/foo.mjs:40:1
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
    at async loadESM (node:internal/process/esm_loader:34:7)
    at async handleMainPromise (node:internal/modules/run_main:106:12) {
  code: ''
}

Node.js v18.19.0

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

The report points to Database.sync in libsql-js/index.js:106 and Sqlite3Client.sync in sqlite3.js:148; begin by reproducing the sync call from foo.mjs:15 and tracing the reported error. Confirm that the resulting message identifies the conflict rather than only exposing the internal error name, then verify the behavior through the relevant sync path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.