fix: align chunk reads with remote delivery

Consume commonlib's delivery lifecycle, classify finite replication entry points, and document why the five-minute inactivity fuse is only a leak safety valve. Record the remote-activity counter correction and preserve continuous replication's unbounded live channel.
This commit is contained in:
vorotamoroz
2026-07-16 20:13:10 +09:00
parent f54d162ef9
commit 9f9758bc12
16 changed files with 792 additions and 28 deletions
+20
View File
@@ -126,6 +126,26 @@ export async function createCouchDbDatabase(config: CouchDbConfig, dbName: strin
}
}
export async function putCouchDbDocument(
config: CouchDbConfig,
dbName: string,
document: CouchDbDocument
): Promise<void> {
const response = await fetch(databaseUrl(config, dbName, `/${encodeURIComponent(document._id)}`), {
method: "PUT",
headers: {
authorization: authHeader(config),
"content-type": "application/json",
},
body: JSON.stringify(document),
});
if (!response.ok) {
throw new Error(
`Failed to write CouchDB document ${document._id}. HTTP ${response.status}: ${await response.text()}`
);
}
}
export async function deleteCouchDbDatabase(config: CouchDbConfig, dbName: string): Promise<void> {
const response = await fetch(databaseUrl(config, dbName), {
method: "DELETE",