Skip to content

fix(docs): doc tree limit + version gate (local CLI vs remote server)#159

Merged
ajianaz merged 3 commits into
developfrom
fix/doc-list-limit-and-tree-toggle
Jul 9, 2026
Merged

fix(docs): doc tree limit + version gate (local CLI vs remote server)#159
ajianaz merged 3 commits into
developfrom
fix/doc-list-limit-and-tree-toggle

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Problems

  1. Truncated doc tree — only ~5 documents showed.
  2. Tree toggle broken — parent folders could not be expanded/collapsed.
  3. Delete faileduteke error: server returned 400 Bad Request.
  4. False upgrade prompt for remote users — Corin asked to uteke upgrade even when connected to a remote server that was fine.

Root causes

  1. uteke-serve POST /doc/list defaults limit to 5. The tree fetches the full flat list client-side → silently capped.
  2. Downstream of (1): folders with no loaded children had isFolder=false → no chevron rendered. Toggle logic itself (Svelte 5 \$state Set/Map) is healthy.
  3. uteke 0.7.0 has no /doc/delete route (added in 0.7.1). The docs gate (MIN_UTEKE_FOR_DOCS = 0.7.0) let Corin hit a missing route.
  4. The version gate read the local uteke --version CLI output even for remote servers — meaningless, since the remote server may be older or newer than the CLI.

Fixes

  • doc_list Tauri command defaults limit to 1000 → fixes (1) and (2) against installed uteke 0.7.0.
  • MIN_UTEKE_FOR_DOCS → 0.7.1 → (3) rejects 0.7.0 up front with a clear message and shows the upgrade banner; uteke upgrade fetches 0.7.1 (released) which has /doc/delete.
  • Remote-aware gating: track AppState::uteke_remote; resolve_uteke_version() probes the server's version via GET /health for remote connections (falls back to local CLI for local servers). Remote + unknown version → lenient (allow through, no banner) since remote servers are user-managed. uteke_self_update skips the local CLI upgrade for remote → fixes (4).

Dependencies / related

Files

  • src-tauri/src/commands.rsAppState::uteke_remote, resolve_uteke_version(), remote-aware require_uteke_version / uteke_version_status / uteke_self_update; doc_list default limit 1000; MIN_UTEKE_FOR_DOCS doc updates.
  • src-tauri/src/lib.rs — set uteke_remote at startup; MIN_UTEKE_FOR_DOCS = "0.7.1"; docs_gate_requires_0_7_1 test.
  • src-tauri/src/uteke_client.rsserver_version() via /health.

Checks

  • cargo fmt / cargo clippy -D warnings
  • cargo test — 14 passed ✅
  • svelte-check — 0 errors ✅
  • vitest — 60 passed ✅
  • CI — 8/8 green ✅

uteke-serve /doc/list defaults limit to 5 (shared memory pagination
default). The doc tree fetches the full flat list client-side to build
the hierarchy, so omitting limit silently capped it at 5 docs.

Side effect: parent folders whose children fell outside the first 5
results had an empty childrenCache, so isFolder evaluated false and no
expand/collapse chevron rendered — the tree could not be toggled.

Default to 1000 in the Tauri command so the installed uteke 0.7.0
works without waiting for the upstream default fix (uteke #634).
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🔍 Cora AI Code Review

No issues found. Code looks good!


Review powered by cora-cli · BYOK · MIT

Bump MIN_UTEKE_FOR_DOCS from 0.7.0 to 0.7.1.

Symptom: deleting a document failed with "uteke error: server returned
400 Bad Request". Root cause: uteke 0.7.0 has no /doc/delete route —
document delete/move landed in 0.7.1. The old gate (0.7.0) let Corin
run against an incomplete server and surface a confusing 400.

Raising the gate to 0.7.1 makes require_uteke_version reject 0.7.0 up
front with a clear message, and the Documents view renders its upgrade
banner so the user runs uteke upgrade (0.7.1 is released) and gets the
full doc feature set.

Comments referencing the old 0.7.0 floor updated across lib/commands/
uteke_client. Added a docs_gate_requires_0_7_1 test.
The documents version gate read AppState::uteke_version, which is the
LOCAL 'uteke --version' CLI output. When Corin connects to a remote
uteke-serve (https/host URL), the local CLI version is irrelevant —
the server may be older or newer — yet the gate compared against the
CLI and falsely told remote users to 'run uteke upgrade'.

Now:
- Track AppState::uteke_remote (set from is_remote_url at startup).
- resolve_uteke_version() probes the remote server's self-reported
  version via GET /health (uteke >= health-version patch) and falls
  back to the cached CLI version for local servers.
- require_uteke_version / uteke_version_status treat a remote server
  with an UNKNOWN version leniently (allow through, no upgrade banner)
  — remote servers are user-managed and surface real errors directly.
  Local servers keep the strict gate.
- uteke_self_update skips the local CLI upgrade for remote servers and
  just re-probes the server version.

Depends on upstream /health version field (uteke #636) for precise
remote detection; without it, remote-unknown is handled leniently so
remote users are no longer blocked.
@ajianaz ajianaz changed the title fix(docs): default doc_list limit to 1000 (fixes truncated tree + toggle) fix(docs): doc tree limit + version gate (local CLI vs remote server) Jul 9, 2026
@ajianaz
ajianaz merged commit fea788d into develop Jul 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant