Skip to content

Commit 2683d7c

Browse files
committed
test(cli): guard graph-query marker control
The pre-write graph-query control only checked for an empty JSON result. If captured stdout and stderr ever contain the query argument, the later marker grep could pass from echoed CLI input instead of a persisted sqlite-wasm row. Failing when the marker appears before the write keeps the positive read-back assertion tied to stored graph data. Validation: - nixfmt modules/_checks/cli-graph-query.nix - nix build .#checks.x86_64-linux.logseq-cli-graph-query - git diff --check - nix build .#checks.x86_64-linux.pre-commit-check
1 parent f250a2a commit 2683d7c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

modules/_checks/cli-graph-query.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ pkgs.runCommand "logseq-cli-graph-query-check" { } ''
5151
if ! printf '%s\n' "$pre_output" | ${pkgs.gnugrep}/bin/grep -qF '"result":[]'; then
5252
fail "pre-write control query returned a non-empty result (marker leaked or query does not filter)" "$pre_output"
5353
fi
54+
if printf '%s\n' "$pre_output" | ${pkgs.gnugrep}/bin/grep -qF "$marker"; then
55+
fail "marker appeared in pre-write output; read-back output cannot distinguish CLI argument echoing from a stored row" "$pre_output"
56+
fi
5457
5558
# 3. Write a real block through the worker: the sqlite-wasm insert path.
5659
# --target-page creates the page on demand, so no separate upsert page step.

0 commit comments

Comments
 (0)