logseq / logseq/db-test

CLI sync remote-graphs reports transport failures as successful graph data

Open
#1,057 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
28
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Search first
  • I searched open and closed issues and found no report for this CLI result-shaping behavior.
What happened?

When the remote graph request fails at the transport layer, logseq sync remote-graphs --output json can return exit code 0 and a top-level success response containing a serialized JavaScript error as if it were a graph.

Observed output:

{
  "status": "ok",
  "data": {
    "graphs": [
      {
        "tag": "js/Error",
        "value": {"message": "fetch failed"}
      }
    ]
  }
}

The underlying failure in this reproduction was a certificate-chain error, but the same result-shaping problem should apply to other rejected fetches.

Reproduce
  1. Configure an authenticated sync endpoint that causes Node fetch to reject.
  2. Run logseq --graph <local-graph> --output json sync remote-graphs.
  3. Observe the JSON and process exit status.
Expected behavior
  • Return a non-zero exit status.
  • Return top-level status: error.
  • Preserve a sanitized error code and root cause.
  • Never include js/Error objects in the graphs collection.
Platform
  • Current CLI repository build
  • Node 22 on macOS arm64
  • Custom DB Sync endpoint

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 tracing the CLI entry point for sync remote-graphs and the JSON response shaping around rejected fetches. Reproduce the failure with logseq --graph <local-graph> --output json sync remote-graphs, then verify that transport failures produce a non-zero exit, top-level status: error, a sanitized cause, and no js/Error entries in graphs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.