Summary
The bridge currently has no built-in mechanism to exclude specific paths from sync. The only exclusion option is .syncignore, which lives inside the vault — awkward when the vault itself is the thing being synced and you want to exclude paths without modifying the vault contents.
Proposed feature
Add an optional excludePrefixes field to PeerStorageConf that accepts an array of posix-relative path prefixes (e.g. ["Photos", "Finance/Ledger", ".git"]). Paths matching any prefix are excluded from both:
- Live dispatch (
dispatch / dispatchDeleted): early-return before reading or processing the file.
- Offline walk (
scanOfflineChanges): passed as skip regexes to Deno's walk() so excluded trees are never traversed at all.
types.ts — add optional field
export interface PeerStorageConf {
group?: string;
name: string;
baseDir: string;
+ excludePrefixes?: string[];
processor?: {
cmd: string,
args: string[]
PeerStorage.ts — add isExcludedPath() and integrate
isExcludedPath(posixRelPath: string): boolean {
const prefixes = this.config.excludePrefixes ?? [];
return prefixes.some(p => {
const norm = p.replace(/^\/+|\/+$/g, "");
return posixRelPath === norm || posixRelPath.startsWith(norm + "/");
});
}
Call at the top of dispatch() and dispatchDeleted(). For the offline walk, build regexes from the prefixes and pass them to walk(lP, { skip: excludeRegexes }).
Rationale
- Complements
.syncignore without requiring a file inside the vault.
- Essential for native (non-Docker) deployments that cannot use Docker volume masking for exclusion.
- The offline walk skip is an optimization — excluded trees are never traversed, reducing scan time and memory.
Related
This feature is used by the deletion reconcile step proposed in the scanOfflineChanges enhancement (issue #59) to avoid tombstoning paths that are intentionally excluded from sync.
Summary
The bridge currently has no built-in mechanism to exclude specific paths from sync. The only exclusion option is
.syncignore, which lives inside the vault — awkward when the vault itself is the thing being synced and you want to exclude paths without modifying the vault contents.Proposed feature
Add an optional
excludePrefixesfield toPeerStorageConfthat accepts an array of posix-relative path prefixes (e.g.["Photos", "Finance/Ledger", ".git"]). Paths matching any prefix are excluded from both:dispatch/dispatchDeleted): early-return before reading or processing the file.scanOfflineChanges): passed asskipregexes to Deno'swalk()so excluded trees are never traversed at all.types.ts— add optional fieldexport interface PeerStorageConf { group?: string; name: string; baseDir: string; + excludePrefixes?: string[]; processor?: { cmd: string, args: string[]PeerStorage.ts— addisExcludedPath()and integrateCall at the top of
dispatch()anddispatchDeleted(). For the offline walk, build regexes from the prefixes and pass them towalk(lP, { skip: excludeRegexes }).Rationale
.syncignorewithout requiring a file inside the vault.Related
This feature is used by the deletion reconcile step proposed in the
scanOfflineChangesenhancement (issue #59) to avoid tombstoning paths that are intentionally excluded from sync.