Skip to main content

Module unlink

Module unlink 

Source
Expand description

lean-ctx cloud unlink (rc4-6): stop sharing one project folder with its vault, on this machine only.

Local only: Cloud has no route to leave a vault, and none is needed. The vault and its data stay in Cloud; this machine just no longer binds the folder to it. Works while disconnected.

In this order (a failure names what was already done):

  1. the folder is remembered as not shared (crate::unlinked): nothing resolves a vault for it again (another checkout of the repository, its main checkout, a kept link file, a session that ends) until cloud link in the folder;
  2. knowledge drafts queued for that folder are dropped, and the capture watermark of the project is reset, so a later share captures their facts again;
  3. the folder leaves its record in projects.json, and the record goes when no folder remains (background sync only syncs recorded vaults);
  4. .lean-ctx-cloud.json in the folder is removed, only when it is a regular file that names that vault on this Cloud (a link to another vault or server, a damaged file or a symlink stays).

Kept: local knowledge, cache, sessions and .lean-ctx-id.

Structs§

Unlinked
What unlink did.

Enums§

KeptReason
Why a link file stayed in the folder.
LinkFile
What became of the folder’s .lean-ctx-cloud.json.
UnlinkError
Why unlink refused.

Functions§

unlink
Stop sharing the project folder root (cloud data dir data_dir; server: the self-hosted server of the connected Cloud, None for the hosted one or when not connected). Idempotent: a folder that is not shared changes nothing (vault: None).