mirror of
https://github.com/aaronsb/obsidian-mcp-plugin.git
synced 2026-07-22 16:40:32 +00:00
Closes #115. Closes #123. The Dataview API returns Luxon DateTime objects (which expose toISO(), not toISOString()) for file.ctime/mtime, so listPages() and getPageMetadata() crashed with "toISOString is not a function" the moment any real Dataview result reached them. The existing tests passed only because the mocks used native Date, which exposes toISOString(). The query path had a separate envelope bug: executeQuery() hard-coded success: true whenever dataviewAPI.query() didn't throw, while Dataview itself returns { successful: false, error: "..." } for malformed queries without throwing. The formatter then read response.successful (undefined), hit the failure branch, and rendered every result as "❌ Query failed: Unknown error" — even when the query had succeeded. - Add toIsoOptional() that prefers Luxon's toISO() and falls back to Date.toISOString(); apply at every page.file.ctime/mtime serialization site and inside convertDataviewValue(). - Propagate result.successful and result.error from the inner Dataview response to the outer tool envelope. - Add a dataview.query normalizer case in the formatter dispatcher that flattens result.{type,values,headers} to the top level and maps success → successful, matching the formatter's contract. - Regression tests for both bugs, including a Luxon-shaped mock distinct from the existing Date-shaped one. |
||
|---|---|---|
| .. | ||
| __mocks__ | ||
| security | ||
| validation | ||
| dataview-integration.test.ts | ||
| graph-search-traversal.test.ts | ||
| list-files-recursive.test.ts | ||
| mcp-server.test.ts | ||
| patch-operations.test.ts | ||
| read-only-mode.test.ts | ||
| recursive-copy.test.ts | ||
| search-tag-operator.test.ts | ||
| setup.ts | ||