Skip to content

Commit cb4e2c8

Browse files
committed
docs(obsidian): clarify hash strategy and re-hydration behavior
1 parent e05291b commit cb4e2c8

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

apps/sim/connectors/obsidian/obsidian.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,13 @@ export const obsidianConnector: ConnectorConfig = {
216216
const pageFiles = allFiles.slice(offset, offset + DOCS_PER_PAGE)
217217

218218
/**
219-
* Stub hash uses path only because the Obsidian Local REST API directory
220-
* listing returns just `{ files: string[] }` — no `stat`/`mtime` and no
221-
* `HEAD` support to read `Last-Modified`. A path-only stub is stable
222-
* across syncs, so unchanged paths short-circuit re-hydration in the
223-
* sync engine. `getDocument` always re-hashes with `mtime`, which
224-
* triggers a refresh whenever the file actually changes.
219+
* The Obsidian Local REST API directory listing returns just
220+
* `{ files: string[] }` — no `stat`/`mtime` and no `HEAD` support to read
221+
* `Last-Modified`, so the stub cannot encode change-detection state. Every
222+
* file is therefore re-hydrated via `getDocument` on every sync. The
223+
* post-hydration hash compare in the sync engine
224+
* (`existing.contentHash === hydratedHash`) prevents redundant DB writes
225+
* when `mtime` is unchanged.
225226
*/
226227
const documents: ExternalDocument[] = pageFiles.map((filePath) => ({
227228
externalId: filePath,

0 commit comments

Comments
 (0)