Fix memory-docs line-count SQL edge case, remove stale tmp-referencing test
Nightly Build / build (push) Successful in 6m46s

- memory_docs list_with_metadata: use SQL substr to detect trailing
  newline instead of counting newlines and adding 1 unconditionally
- list_files: remove meta_smoke tests that referenced a non-existent
  scratchpad directory
This commit is contained in:
2026-07-22 22:34:09 +01:00
parent 7769b6689d
commit aa4f31ec64
2 changed files with 2 additions and 41 deletions
+2 -1
View File
@@ -102,7 +102,8 @@ pub async fn list_with_metadata(pool: &SqlitePool, prefix: &str) -> Result<Vec<M
let rows = sqlx::query_as::<_, MemoryEntryMeta>(
"SELECT path,
CASE WHEN content = '' THEN 0
ELSE LENGTH(content) - LENGTH(REPLACE(content, char(10), '')) + 1
ELSE LENGTH(content) - LENGTH(REPLACE(content, char(10), ''))
+ CASE WHEN substr(content, -1, 1) = char(10) THEN 0 ELSE 1 END
END AS line_count,
LENGTH(CAST(content AS BLOB)) AS byte_len
FROM memory_docs