db-sync server: CLI bulk upserts fail against E2EE graphs (tx-rejected invalid data)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
Hướng nghiên cứu
Start by tracing the logseq-cli upsert commands and the sync worker path that queues and sends transactions; the issue does not name source files or tests. Check how graph E2EE metadata and password handling are currently read, then reproduce the rejected transaction with an E2EE graph. Done means the CLI encrypts writes correctly or fails locally before queuing plaintext transactions when no password is available.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug: logseq-cli fails to encrypt payloads for E2EE graphs, resulting in silent local success and remote tx-rejected
Environment
- OS: macOS (darwin arm64) and NixOS
- Logseq Version: 2.0.2 Beta (Revision:
533ac4382a7b69baa98de3a973bff90305b212dc) - CLI Execution: Wrapped via
ELECTRON_RUN_AS_NODE=1 node dist/logseq.js
Description
When running logseq-cli commands (upsert page, upsert block) against an End-to-End Encrypted (E2EE) graph, the CLI successfully writes to the local transaction queue but fails to encrypt the payload. The sync worker pushes raw plaintext datoms to the sync server, which immediately rejects them with DB write failed with invalid data.
Because the CLI runs under a raw Node environment (ELECTRON_RUN_AS_NODE=1), it bypasses the Electron renderer and does not have access to the safeStorage native API to decrypt the Logseq E2EE macOS keychain blob (["~btn5rO..."]).
Steps to Reproduce
- Enable E2EE on a graph in Logseq Desktop (e.g.,
<my-graph>). - Start the CLI sync worker:
logseq sync start --graph <my-graph> --output json - Execute a write operation:
logseq upsert page --graph <my-graph> --page "New Page Test" --output json - The CLI returns success:
{"status":"ok","data":{"result":[32982]}} - Check sync status:
logseq sync status --graph <my-graph> --output json
Actual Behavior
The sync status reports a fatal tx-rejected error. The error-detail reveals the server rejected the transaction because the :tx-data contains raw plaintext datoms instead of the expected encrypted ciphertext blob.
{
"code": "tx-rejected",
"message": "tx-rejected",
"data": {
"type": "db-sync/tx-rejected",
"repo": "logseq_db_<my-graph>",
"message-type": "tx/reject",
"reason": "db transact failed",
"error-detail": "#error {:message \"tx entry apply failed\", :cause #error {:message \"DB write failed with invalid data\", :data {:tx-meta {:op :apply-client-tx, :client-revision \"533ac43\", :outliner-op :create-page}, :tx-data ([:db/add \"6af5d87a-eba3...\" :block/uuid #uuid \"6af5d87a-eba3...\"] ...) } }}"
}
}
Expected Behavior
- The CLI should recognize the graph is E2EE (
metadata.jsonorconfig.json). - It should either:
- Extract the master key and decrypt the E2EE password (currently impossible via
ELECTRON_RUN_AS_NODE). - Allow passing the raw unencrypted password securely via a CLI flag or environment variable (e.g.,
LOGSEQ_E2EE_PASSWORD) duringupsert. - Hard-fail the
upsertcommand immediately locally if the graph is E2EE and no password is provided, rather than returningstatus: okand corrupting the sync queue with rejected plaintext transactions.
- Extract the master key and decrypt the E2EE password (currently impossible via
Impact
CLI-driven bulk imports, programmatic upserts, and background agents are completely blocked from writing to E2EE graphs. The local DB worker gets wedged trying to push the invalid transaction, requiring manual local transaction rollback or worker restarts.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 29
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của logseq/db-test
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Potential Dataloss: Deleting an entry from the property page's node table has no confirmation dialogCó thể đã có người làm @tiensonqin đã nhận 59 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Disabling Flashcards in Settings does not disable Flashcard shortcuts or tagsCó thể đã có người làm @tiensonqin đã nhận 60 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Tất cả issue của logseq/db-test
Issue tương tự
-
area:core area:install area:sandbox area:state area:tui os:windows
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 62/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
diivi/aseprite-mcp#43 ·
-
ai-driven-qa bug Critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
area: agents
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
manaflow-ai/cmux#50925 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
georgestephanis/diff-leppard#46 ·
Maintainer thường phản hồi trong vòng 1 ngày