feat: opt-in desktop setting to keep replication active in the background

Replication is suspended when the Obsidian window becomes hidden (document.hidden),
so LiveSync and Periodic stop syncing while minimised until the window is focused.

Add keepReplicationActiveInBackground (default off, desktop only). When enabled, the
window-visibility handler no longer suspends on hide, so replication keeps running while
minimised. Becoming visible forces a teardown before reopen (LiveSync only) so a stalled,
half-open channel is always replaced.

Includes the setting definition (src/lib submodule), a desktop-only toggle in the Sync
pane shown for LiveSync and Periodic, a docs/settings.md entry, and unit tests for the
visibility handler.
This commit is contained in:
Miguel Ferreira
2026-06-04 21:09:45 +01:00
parent 31050c9cb8
commit c78e583399
5 changed files with 220 additions and 4 deletions
+5
View File
@@ -488,6 +488,11 @@ Automatically Sync all files when opening Obsidian.
Setting key: syncAfterMerge
Sync automatically after merging files
#### Keep replication active in the background
Setting key: keepReplicationActiveInBackground
Desktop only; uses more battery and network.
### 3. Update thinning
#### Batch database update