mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-29 22:12:31 +00:00
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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user