Add CouchDB cache compatibility controls and native revalidation

This commit is contained in:
vorotamoroz committed 2026-11-03 01:04:36 +00:00
1 parent 7166de3291
commit 667d6bed1f
9 files changed
+283 -11

No files matched your search

@@ -82,6 +82,7 @@ export function getCouchDBReplicatorConfigurationIdentity(settings: RemoteDBSett
authentication,
projectHeaders(settings.couchDB_CustomHeaders),
settings.useRequestAPI,
settings.useCouchDBCacheControlHeadersOnly === true,
settings.disableRequestURI,
projectRemoteSecurity(settings),
usesEncryptedInternalMetadata(settings),
@@ -7,6 +7,17 @@ import {
} from "./replicatorConfigurationIdentity";
describe("active Replicator configuration identity", () => {
it("treats an absent headers-only CouchDB cache switch as off and leaves Object Storage unaffected", () => {
const absent = configuredSettings();
Reflect.deleteProperty(absent, "useCouchDBCacheControlHeadersOnly");
expect(getCouchDBReplicatorConfigurationIdentity({ ...absent, useCouchDBCacheControlHeadersOnly: false })).toBe(
getCouchDBReplicatorConfigurationIdentity(absent)
);
expect(getObjectStorageReplicatorConfigurationIdentity({ ...absent, useCouchDBCacheControlHeadersOnly: true })).toBe(
getObjectStorageReplicatorConfigurationIdentity(absent)
);
});
it("replaces a connection when the path identity mode changes", () => {
const previous = configuredSettings({ pathNormalizationVersion: 0 });
const next = { ...previous, pathNormalizationVersion: 1 as const };
@@ -73,6 +84,7 @@ describe("active Replicator configuration identity", () => {
["couchDB_PASSWORD", "secret-b"],
["couchDB_CustomHeaders", "X-First: changed"],
["useRequestAPI", true],
["useCouchDBCacheControlHeadersOnly", true],
["disableRequestURI", true],
["encrypt", false],
["passphrase", "encryption-b"],