Commit Graph

24277 Commits

Author SHA1 Message Date
Tienson Qin
122e8a2370 fix: speed up markdown mirror imports 2026-05-06 16:08:52 +08:00
Tienson Qin
90e8ea4693 fix: stabilize markdown mirror imports
Summary:
- remove block id marker compatibility and rely on JSON sidecar snapshots
- harden duplicate block matching, deletes, follow-up edits, tags, and task status sync
- cap watcher imports at 100 KiB and skip oversized files before reading when stats are available
- update ADRs for JSON sidecars and constrained two-way sync behavior

Tests:
- rtk bb dev:test -v frontend.worker.markdown-mirror-test
2026-05-06 16:08:52 +08:00
Tienson Qin
b8f38b057b fix: stabilize markdown mirror sparse ids
Summary:
- Add sidecar-backed matching for sparse block ids so ordinary blocks can omit visible id:: metadata.
- Preserve edited markdown sibling order when inserts/deletes happen around existing blocks.
- Reject ambiguous unmarked duplicate edits instead of guessing block identity.
- Document sidecar storage and matching rules in markdown mirror ADRs.
- Add deterministic and seeded randomized markdown edit roundtrip coverage.
2026-05-06 16:08:52 +08:00
Tienson Qin
9b45ffbaa1 fix: sparsify markdown mirror block ids
Render block id:: lines only when a block needs stable visible identity, such as incoming references or non-basic DB state.

Match unmarked imported blocks back to existing DB blocks by sibling structure and stable content so file-origin edits preserve UUIDs for sync instead of delete/recreate churn.

Update markdown mirror ADRs and add regression coverage for sparse output, referenced-block ids, unmarked edit/delete/insert identity preservation, and insert-before-existing ordering.
2026-05-06 16:08:52 +08:00
Tienson Qin
2a9e852ea4 fix: use id properties for markdown mirror ids 2026-05-06 16:08:52 +08:00
Tienson Qin
8de088e199 feat: sync markdown mirror edits
Add Chokidar-backed Markdown Mirror file watching in the DB worker and start the watcher when Markdown Mirror is enabled. Regenerate mirror files on enable so external editors see current content immediately.

Import a constrained set of mirror edits back into DB graphs: existing block content edits, new block insertion, block removal by omitted markers, page and journal creation from new files, page refs, and inline tags. Ignore mirror property edits and dangerous file delete/move events.

Keep the importer strict: only Logseq '- ' list items are writable block boundaries, indented Markdown stays as block content, fenced code lines cannot create blocks, and unsupported top-level Markdown is rejected. Update ADR 0016 with this contract.

Verified with: rtk bb dev:test -v frontend.worker.markdown-mirror-test; rtk bb dev:test -v frontend.worker.db-core-test/db-core-registers-all-thread-apis-test; Chokidar require smoke test from resources/.
2026-05-06 16:08:52 +08:00
Tienson Qin
f925010ee5 Add ADR 0017 for two way sync between markdown and db 2026-05-06 16:08:52 +08:00
Tienson Qin
c77d54729f fix: sync markdown mirror graph setting 2026-05-06 16:08:52 +08:00
Tienson Qin
1ad150e137 fix: enable markdown mirror per graph 2026-05-06 16:08:52 +08:00
copilot-swe-agent[bot]
721249d8de fix: delete old mirror path on rename when new path content is unchanged
Agent-Logs-Url: https://github.com/logseq/logseq/sessions/9db79397-9189-4b9b-a75c-ec333a6ca7b5

Co-authored-by: tiensonqin <479169+tiensonqin@users.noreply.github.com>
2026-05-06 16:08:52 +08:00
Tienson Qin
b5eeb82689 fix: update markdown mirror 2026-05-06 16:08:52 +08:00
Tienson Qin
cd31a39fef feat: add markdown mirror
Add markdown mirror generation for DB graphs, including page and journal paths, regeneration, debounced write handling, and settings UI.

Serialize page and block property values into mirrored Markdown by resolving property-value entities to their display content.

Persist mirror files through the node worker platform and make browser worker mirror storage fail fast as unsupported.

Fix Electron userAppCfgs writes to avoid returning unserializable Electron state over IPC.

Add ADR and targeted tests for mirror generation, worker wiring, platform storage, and graph path handling.
2026-05-06 16:08:52 +08:00
rcmerci
7a731c6044 enhance(cli): render block/link in show 2026-05-06 15:29:01 +08:00
PlunderStruck
3b7bc2e5d8 dev: remove developer command cycle 2026-05-06 08:15:04 +08:00
rcmerci
8a7ba2f665 fix(import): preserve emails in quote blocks 2026-05-05 21:13:39 +08:00
Tienson Qin
20c7930727 fix: clear sync inflight on reconnect
Summary:
- Clear pending inflight tx ids when a db-sync websocket closes or is detected stale closed.
- Cover websocket close and stale-loop cleanup so reconnect can flush pending local txs again.

Tests:
- bb dev:test -v frontend.worker.sync.restart-test/ws-close-clears-inflight-before-reconnect-test
- bb dev:test -v frontend.worker.sync.restart-test/stale-loop-marks-non-open-ws-closed-test
- bb dev:test -v frontend.worker.sync.restart-test
2026-05-05 17:50:39 +08:00
Tienson Qin
a544e7f407 fix: guard focused root block indent/outdent and move ops 2026-05-05 16:56:19 +08:00
Will Wu
79f55b978a fix: prevent blocks from being outdented past zoom root in focused view
When viewing a page in zoom/focus mode, pressing Shift+Tab could outdent
blocks past the zoom root boundary, causing them to disappear from the
focused view. This adds a guard in both single-block (indent-outdent) and
multi-block (on-tab) code paths to check for the zoom boundary.

Fixes #12582
2026-05-05 16:56:19 +08:00
rcmerci
882694e4f4 fix(ci): random fails when parallel execution of cli-e2e test
so we are switching it to --jobs 1 for now
2026-05-05 16:24:57 +08:00
rcmerci
0b55e03110 enhance(skill): update logseq-repl 2026-05-05 16:07:12 +08:00
Tienson Qin
619be47fe2 add missing thread api tests for db core 2026-05-05 15:30:41 +08:00
hoellen
797635e349 fix: scope RSA key pair cache by server URL (#12586) 2026-05-05 14:58:16 +08:00
Tienson Qin
6439791230 fix: no unlinked references 2026-05-05 13:44:10 +08:00
Tienson Qin
13779a4047 fix: don't update local tx to 0 except for two cases
1. creating a remote graph
2. uploading a local graph
2026-05-05 13:35:45 +08:00
rcmerci
47407a3d8d fix(import): property value has custom format journal page ref 2026-05-05 12:46:41 +08:00
rcmerci
ca08579d47 enhance(cli): increase timeout for 'sync upload' 2026-05-04 22:43:49 +08:00
rcmerci
ebb0732f45 dev: remove ns logseq.cli.integration-test 2026-05-04 21:54:47 +08:00
rcmerci
0d9fa816c0 fix test 2026-05-04 21:46:39 +08:00
rcmerci
caaf8f4a6b enhance(skill): update logseq-cli 2026-05-04 21:29:45 +08:00
rcmerci
f5b122ddd5 enhance(cli): add --enable-sync to 'graph create' 2026-05-04 21:13:13 +08:00
rcmerci
7488b92407 fix: switch graph if db-worker-node server unreachable 2026-05-04 14:07:03 +08:00
rcmerci
137dd7fefd enhance: unify build-version 2026-05-04 12:31:54 +08:00
rcmerci
2f0a4f37e5 enhance(db-worker-node): restart server on version mismatch 2026-05-04 10:36:20 +08:00
charlie
8b510ea034 fix(marketplace): enhance image tag handling in Markdown content 2026-05-04 08:45:24 +08:00
Tienson Qin
a7672eb69c add server usage skills 2026-05-04 08:18:39 +08:00
Tienson Qin
b8ebdd575c add server usage stats script (#12557)
* enhance(db-sync): add usage stats script

* fix(db-sync): use --local for local D1 scripts

* fix(db-sync): record activity only on successful sync requests

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-04 07:59:15 +08:00
Tienson Qin
9bdfa5655d fix: plugins e2e tests 2026-05-04 07:24:56 +08:00
Tienson Qin
7843ac1c81 fix: e2e tests 2026-05-04 00:08:43 +08:00
Tienson Qin
3f78f3a3d2 chore: remove warning on path join with empty dir 2026-05-04 00:02:59 +08:00
Victor239
8b20877f7f fix(electron): repair custom URI scheme links
The npm `open` package (v8.4.2) is CommonJS with `module.exports = open;`
and no `.default` property, so importing it as `["open" :default open-external]`
left `open-external` undefined. Every custom-scheme click (freetube://, tg://,
etc.) reached `open-default-app!`, showed the confirmation dialog, and then
threw `TypeError: ...default is not a function` from inside (default-open url),
which Electron logged as an uncaughtException with no user-visible feedback.

Switch to `:as open-external` so the symbol binds to module.exports itself
(the open function). The neighboring node-fetch import is left as `:default`
because node-fetch v2.7.0 explicitly sets `exports.default = exports` for
ESM-interop, so it actually has a default export.

Regression from d6403b7746 (#12460), which replaced the prior working
`(defonce open (js/require "open"))` with the shadow-cljs ESM-style import.
2026-05-03 23:48:57 +08:00
Tienson Qin
3be77b6bfb remove outdated tests 2026-05-03 23:46:55 +08:00
Tienson Qin
63fab0ca86 Recommmend nightly instead of non-release action artifact 2026-05-03 23:28:11 +08:00
Tienson Qin
c326dbf4e3 fix: lint 2026-05-03 23:24:52 +08:00
Tienson Qin
843dfc78d4 fix: support flat client-ops sqlite export path 2026-05-03 23:23:25 +08:00
Tienson Qin
e8de3cc104 fix: sqlite import 2026-05-03 23:16:37 +08:00
Tienson Qin
c647326d86 fix: remove sqlite file header format check 2026-05-03 22:58:10 +08:00
Tienson Qin
ac102e70fe fix: correct db-worker ui request response args 2026-05-03 22:22:45 +08:00
Tienson Qin
74c2cc9393 fix: Android compile 2026-05-03 21:50:33 +08:00
Tienson Qin
c6ac84cd28 fix: can't export db on browser 2026-05-03 21:24:24 +08:00
Tienson Qin
9145dd41db remove agent session artifact 2026-05-03 20:34:43 +08:00