Device-local recovery copies of a plugin’s data.json, kept BEFORE anything could lose what the file held.
Two cases lose a user’s settings for good without one. A data.json that does not parse (truncated by a sync tool, a crash mid-write, a hand edit) reads as missing, because Obsidian’s Vault.readJson swallows the parse error (read from 1.15.1); and a record that parses but holds values the plugin drops or rewrites (an unknown key from a newer plugin version, a legacy migration) is normalized and saved back over the file on the initial load. A copy of the raw text is kept first, in a LocalDataStore, so no sync tool carries it to other devices and nothing is added to the vault.
| Class |
Description |
| LocalSettingsRecoveryStore |
A SettingsRecoveryStore in a device-local LocalDataStore, keeping the newest few copies. It opens its database per call and closes it again: copies are kept and read rarely (a load that found a damaged file, a lossy first save, the user asking for the list), so holding a connection for the plugin’s lifetime would only add a resource to tie to an unload. |