Commit Graph
17 Commits
Author SHA1 Message Date
vorotamoroz 8316a14ef8 Integrate watched file names with CLI path exclusions 2026-11-12 15:03:28 +00:00
vorotamoroz 2a65fe0117 Maintain watched file names for CLI collision checks
Share the CLI watcher with a reconciled name inventory, observe local
mutations, and retain newer notifications across overlapping reads.
Adopt the shared index for Obsidian and preserve fresh bulk operations.
2026-11-12 14:04:17 +00:00
vorotamoroz 116c2dfbfb fix(cli): share Vault-relative path exclusions
Apply watcher and logical-target exclusions within the selected Vault so
hidden or database-like parent directories do not suppress monitoring.
Protect primary, previous, and view databases, and provide a runtime opt-in
for ordinary database-like directories without changing database ownership.

Cover hidden roots, symlink restarts, exclusion parity, and encrypted
CouchDB create, modify, and delete operations with regression tests.

Refs #1340
2026-11-12 08:51:11 +00:00
vorotamoroz 61b51bcb4e Merge CLI database continuity into shared runtime integration 2026-11-01 05:17:19 +00:00
vorotamoroz d50ee9a83e Preserve CLI database continuity after reconstruction 2026-11-01 05:06:42 +00:00
vorotamoroz b9dcb0d4c7 Share application adapter and diagnostic helpers 2026-10-29 15:04:09 +00:00
vorotamoroz 0bcd9af6a5 Preserve CLI file creation times across in-place edits 2026-10-15 11:07:43 +00:00
vorotamoroz 00de35e5d4 Merge current main into PR 1039 2026-08-09 08:45:16 +00:00
Andrew Leech 4393a49cba fix(cli): floor watch-mode stat timestamps to integer ms
CLIWatchAdapter._toNodeFile passed chokidar's raw stats.ctimeMs/mtimeMs
straight through. On Linux those carry sub-millisecond precision (e.g.
1778511180024.462), so watch-mode file changes wrote non-integer
timestamps into the database.

The earlier floor fix (3f7bb047) covered the scan/stat adapters but missed
this watch path, which is the one the daemon actually uses at runtime.
Mobile clients then crash on such a document because Capacitor's
Filesystem.setTimes casts the value to a Java Long (ClassCastException:
Double cannot be cast to Long).

Floor ctimeMs/mtimeMs here, with a null guard so a partial stat still
falls back to Date.now(). Adds a regression test that a fractional stat is
floored.

Claude-Session: https://claude.ai/code/session_0123E9jVQrsgu3zb82Csuwhi
2026-07-22 14:08:21 +10:00
vorotamoroz 97964fddf1 refactor: inject CLI I/O and diagnostics 2026-07-17 16:01:48 +00:00
vorotamoroz a721d3b602 refactor: consume Commonlib as a package 2026-07-17 11:13:16 +00:00
vorotamoroz ae9c46f8f0 Fix import paths 2026-06-17 04:39:39 +01:00
vorotamoroz f8998d5441 (fixed): No longer path corruption on windows environment (at least, pass the check) on CLI 2026-06-04 10:17:34 +01:00
vorotamoroz bb77426b7b update dependencies and bump 2026-06-02 12:50:46 +01:00
vorotamoroz 7d2ba1b0b9 ### Improved
- Database fetching (a.k.a. Reset Synchronisation on This Device) on the initialisation now supports streaming and is faster (CouchDB only)
- The database fetching process has been streamlined, and database operations are now suspended until it has been completed
- The initial synchronisation process has been simplified, making it easier to synchronise files with the remote server
- We can select the remote database to fetch from during the initialisation, when there are multiple remote databases configured (e.g. multiple CouchDBs or S3 remotes)
2026-06-02 12:34:46 +01:00
vorotamoroz 6a9bba702c chore: ran prettier 2026-05-13 14:10:56 +01:00
Andrew Leech e6ae516493 cli: implement local→CouchDB file watching via chokidar
- Add chokidar ^4.0.0 as dependency (root package.json, runtime-package.json)
- Mark chokidar as external in vite.config.ts (not bundled, loaded at runtime)
- Implement CLIWatchAdapter.beginWatch() with chokidar:
  - ignoreInitial: true (startup files handled by mirror scan)
  - awaitWriteFinish to prevent partial-write events
  - Excludes dotfiles and .livesync/ directory at watcher level
  - Maps add/change/unlink/addDir/unlinkDir to IStorageEventWatchHandlers
  - Fatal error handler: logs clearly and releases watcher resources
- Add close() to CLIWatchAdapter, StorageEventManagerCLI for clean shutdown
- Register onUnload hook in CLIServiceModules to close watcher on shutdown
2026-05-13 11:21:06 +10:00