@vrtmrz/livesync-commonlib 0.1.36 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/settingConstants.js +1 -1
- package/dist/services/base/CommonlibMessages.d.ts +7 -0
- package/dist/services/base/CommonlibMessages.js +7 -0
- package/dist/services/base/IService.d.ts +3 -1
- package/dist/services/base/SettingService.d.ts +19 -3
- package/dist/services/base/SettingService.js +263 -48
- package/dist/worker/bgWorker.js +1 -1
- package/docs/proven-in-use.md +2 -0
- package/docs/settings-lifecycle.md +6 -0
- package/package.json +4 -4
package/docs/proven-in-use.md
CHANGED
|
@@ -8,6 +8,8 @@ The code paths below identify the maintained Self-hosted LiveSync composition po
|
|
|
8
8
|
|
|
9
9
|
## Obsidian plug-in
|
|
10
10
|
|
|
11
|
+
Unreleased configuration-encryption tests cover changing the wrapper key without changing connection, E2EE, profile, or independent ID values. They also cover custom-key input before loading, failed writes, concurrent saves, cancellation, and unreadable-payload retention. Commonlib owns these service results. LiveSync owns the Apply controls, setting-tab registration, and database startup order; actual Apply and restart behaviour requires its focused real-Obsidian scenario.
|
|
12
|
+
|
|
11
13
|
The CouchDB connection fix bypasses browser HTTP caching so encrypted replication can continue after a remote Rebuild preserves document IDs and revisions. Commonlib's regression tests cover Metadata and Chunks encrypted with a replacement Security Seed while an earlier response remains cached. Self-hosted LiveSync's `couchdb-http-cache` scenario additionally populates the real browser HTTP cache before rebuilding, confirms that the Seed and ciphertext change while the revision remains unchanged, and requires subsequent replication to succeed without clearing that cache. The released LiveSync 1.0.34 fails this scenario; a local checked Commonlib artefact passes in the maintained LiveSync 1.0.34 composition on Linux Obsidian 1.12.7. This establishes the tested build's behaviour, with the reporter's Windows and Obsidian 1.13.7 environment still unverified.
|
|
12
14
|
|
|
13
15
|
Unreleased settings tests verify that Object Storage-only credentials, JWT values, and authentication headers reach the host persistence handler only after connection encryption, and that unavailable or failed required encryption preserves the previous persisted settings. The focused `/settings` entry also supplies conditional whole-profile Markdown preparation and import preservation. A clean packed consumer checks the exhaustive property policy and prepared output types with an ES2018 compile fixture. Commonlib owns these result and type contracts; Self-hosted LiveSync owns Markdown file writes, its settings interface, and restoration through a real Obsidian restart.
|
|
@@ -74,6 +74,10 @@ The standard Commonlib `SettingService` performs this preparation automatically.
|
|
|
74
74
|
|
|
75
75
|
## Preparing settings for persistence and Markdown
|
|
76
76
|
|
|
77
|
+
The existing `SettingService` provides `changeConfigurationEncryption(store, passphrase?)` for hosts which edit the configuration encryption mode or device-local custom key. Await it before marking those edits as saved. It prepares one wrapper key for connection credentials, the E2EE passphrase, remote profile URIs, and the independent ID key, and serialises the change with ordinary settings saves. It rejects empty keys and unreadable existing protected items. A failed write attempts to restore the previous device key and does not send a success event. The device key and settings document use separate host writes, so this is not a guarantee of rollback after process termination or an uncertain persistence error.
|
|
78
|
+
|
|
79
|
+
When `loadSettings()` cannot validate a custom configuration key, it requests a masked key through the host's existing `confirm.askString` capability. It validates each candidate on a fresh copy and stores only a validated key before continuing initialisation. Cancellation or unavailable input stops that load without changing the saved settings. The ID-key rejection contract remains in `decryptSettings()`; loading never replaces a missing or invalid ID key with another key. ASK mode retains one successful in-memory key for ordinary saves in that launch. Hosts own the visible prompt, cancellation on disposal, and the policy which prevents database and replication work before loading completes.
|
|
80
|
+
|
|
77
81
|
`SettingService` prepares a separate settings object before calling the host's persistence handler. Object Storage credentials, CouchDB credentials, JWT values, and authentication headers share the existing `encryptedCouchDBConnection` payload. Encryption runs when any protected connection property is present, including when every CouchDB property is empty. The same policy supplies the properties encrypted, cleared before saving, and restored on loading. Older plaintext settings and encrypted payloads without newer properties remain readable.
|
|
78
82
|
|
|
79
83
|
An unavailable configuration passphrase or an empty connection-encryption result stops the save before the host's persistence handler receives the object. Remote profile URI encryption also stops on failure when a configuration passphrase is explicitly selected. The previous persisted settings remain intact. Removing all connection values clears an older encrypted payload only after it can be decrypted, preserving recovery after a failed decryption. Profile names, IDs, and selections remain ordinary settings; profile URIs are encrypted separately.
|
|
@@ -116,3 +120,5 @@ The settings schema version is independent of the package version and of any rem
|
|
|
116
120
|
The settings lifecycle unit tests cover blank stores, representative legacy choices, migration idempotence, legacy file-name case normalisation, legacy review state, future-schema downgrade protection, and the distinction between new-Vault recommendations and stored-setting fallbacks. Credential tests cover Object Storage-only persistence, JWT and header restoration, legacy settings, removed credentials, encryption failures, conditional whole-profile Markdown export, and preservation of local values on import. Tweak-assessment tests cover effective defaults, unadvertised values, directional change sets, reconstruction impact, raw representation differences, immutable snapshots, and document-ID case behaviour. The packed-package test imports the focused `/settings` entry from a clean consumer and checks its declarations and runtime exports. Its ES2018 compile fixture checks missing policies and attempts to bypass prepared output types.
|
|
117
121
|
|
|
118
122
|
Hosts remain responsible for testing when setup is classified as new, how local review acknowledgement is stored, how replication is gated, and how their settings interface presents the result.
|
|
123
|
+
|
|
124
|
+
`SettingService.configurationEncryption.unit.spec.ts` covers key changes with ID versions 0 and 1, stale-cache avoidance, per-launch ASK reuse, concurrent saves, preparation and persistence errors, rollback reporting, custom-key input and cancellation, and retention of unreadable items. These are Commonlib-owned service contracts; Apply controls and real application restarts require downstream verification.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vrtmrz/livesync-commonlib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.39",
|
|
4
4
|
"description": "Shared data, storage, and replication primitives for Self-hosted LiveSync clients.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -1008,9 +1008,9 @@
|
|
|
1008
1008
|
"events": "^3.3.0",
|
|
1009
1009
|
"fflate": "^0.8.2",
|
|
1010
1010
|
"idb": "^8.0.3",
|
|
1011
|
-
"markdown-it": "^14.2
|
|
1012
|
-
"minimatch": "^10.2.
|
|
1013
|
-
"octagonal-wheels": "^0.1.
|
|
1011
|
+
"markdown-it": "^14.3.2",
|
|
1012
|
+
"minimatch": "^10.2.6",
|
|
1013
|
+
"octagonal-wheels": "^0.1.55",
|
|
1014
1014
|
"pouchdb-adapter-http": "^9.0.0",
|
|
1015
1015
|
"pouchdb-adapter-idb": "^9.0.0",
|
|
1016
1016
|
"pouchdb-adapter-indexeddb": "^9.0.0",
|