desktop/owned-instance/persistent-profile
A persistent user-data profile for an owned desktop instance: a directory the caller keeps (and signs in to once, by hand), which the harness launches against instead of a fresh temporary one. Used to drive Obsidian Sync and Obsidian Publish, whose account and connection live in the profile’s localStorage and IndexedDB.
Two things differ from a temporary profile, and both live here as pure functions:
obsidian.jsonis merged, never overwritten. The profile’s registry already lists the vault the owner connected to Sync, under the id Sync keys its connection to, so the vault is reused under that id, every other vault is kept, and only the auto-open markers andupdateDisabledchange (the latter only for the run, seepersistent-profile-updates.ts). - One instance per profile. Two Electron processes on one user-data directory corrupt each other’slocalStorage, and Electron’s own single-instance lock would hand the second launch to the first and exit. So the harness takes a lock file in the profile and refuses a second run while the holder is alive.
Classes
Section titled “Classes”| Class | Description |
|---|---|
| PersistentProfileInUseError | Thrown when a second run asks for a persistent profile another live process holds. |
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| PersistentProfileInUseErrorConstructorParams | Parameters for PersistentProfileInUseError. |
| PersistentProfileLock | The contents of a persistent profile’s lock file. |