mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-13 17:55:56 +00:00
## 0.24.28
### Fixed - Batch Update is no longer available in LiveSync mode to avoid unexpected behaviour. (#653) - Now compatible with Cloudflare R2 again for bucket synchronisation. - Prevention of broken behaviour due to database connection failures added (#649).
This commit is contained in:
2
src/lib
2
src/lib
Submodule src/lib updated: d2e1e5a51e...3f3cf7d61d
@@ -244,6 +244,7 @@ Even if you choose to clean up, you will see this option again if you exit Obsid
|
|||||||
async loadQueuedFiles() {
|
async loadQueuedFiles() {
|
||||||
if (this.settings.suspendParseReplicationResult) return;
|
if (this.settings.suspendParseReplicationResult) return;
|
||||||
if (!this.settings.isConfigured) return;
|
if (!this.settings.isConfigured) return;
|
||||||
|
try {
|
||||||
const kvDBKey = "queued-files";
|
const kvDBKey = "queued-files";
|
||||||
// const ids = [...new Set(JSON.parse(localStorage.getItem(lsKey) || "[]"))] as string[];
|
// const ids = [...new Set(JSON.parse(localStorage.getItem(lsKey) || "[]"))] as string[];
|
||||||
const ids = [...new Set((await this.core.kvDB.get<string[]>(kvDBKey)) ?? [])];
|
const ids = [...new Set((await this.core.kvDB.get<string[]>(kvDBKey)) ?? [])];
|
||||||
@@ -260,7 +261,9 @@ Even if you choose to clean up, you will see this option again if you exit Obsid
|
|||||||
include_docs: true,
|
include_docs: true,
|
||||||
limit: 100,
|
limit: 100,
|
||||||
});
|
});
|
||||||
const docs = ret.rows.filter((e) => e.doc).map((e) => e.doc) as PouchDB.Core.ExistingDocument<EntryDoc>[];
|
const docs = ret.rows
|
||||||
|
.filter((e) => e.doc)
|
||||||
|
.map((e) => e.doc) as PouchDB.Core.ExistingDocument<EntryDoc>[];
|
||||||
const errors = ret.rows.filter((e) => !e.doc && !e.value.deleted);
|
const errors = ret.rows.filter((e) => !e.doc && !e.value.deleted);
|
||||||
if (errors.length > 0) {
|
if (errors.length > 0) {
|
||||||
Logger("Some queued processes were not resurrected");
|
Logger("Some queued processes were not resurrected");
|
||||||
@@ -268,10 +271,22 @@ Even if you choose to clean up, you will see this option again if you exit Obsid
|
|||||||
}
|
}
|
||||||
this.replicationResultProcessor.enqueueAll(docs);
|
this.replicationResultProcessor.enqueueAll(docs);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Logger(`Failed to load queued files.`, LOG_LEVEL_NOTICE);
|
||||||
|
Logger(e, LOG_LEVEL_VERBOSE);
|
||||||
|
} finally {
|
||||||
|
// Check again before awaiting,
|
||||||
if (this.replicationResultProcessor.isSuspended) {
|
if (this.replicationResultProcessor.isSuspended) {
|
||||||
this.replicationResultProcessor.resume();
|
this.replicationResultProcessor.resume();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// Wait for all queued files to be processed.
|
||||||
|
try {
|
||||||
await this.replicationResultProcessor.waitForAllProcessed();
|
await this.replicationResultProcessor.waitForAllProcessed();
|
||||||
|
} catch (e) {
|
||||||
|
Logger(`Failed to wait for all queued files to be processed.`, LOG_LEVEL_NOTICE);
|
||||||
|
Logger(e, LOG_LEVEL_VERBOSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
replicationResultProcessor = new QueueProcessor(
|
replicationResultProcessor = new QueueProcessor(
|
||||||
|
|||||||
@@ -2090,7 +2090,12 @@ The pane also can be launched by \`P2P Replicator\` command from the Command Pal
|
|||||||
.autoWireToggle("syncAfterMerge", { onUpdate: onlyOnNonLiveSync });
|
.autoWireToggle("syncAfterMerge", { onUpdate: onlyOnNonLiveSync });
|
||||||
});
|
});
|
||||||
|
|
||||||
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleUpdateThinning")).then((paneEl) => {
|
void addPanel(
|
||||||
|
paneEl,
|
||||||
|
$msg("obsidianLiveSyncSettingTab.titleUpdateThinning"),
|
||||||
|
undefined,
|
||||||
|
visibleOnly(() => !this.isConfiguredAs("syncMode", "LIVESYNC"))
|
||||||
|
).then((paneEl) => {
|
||||||
paneEl.addClass("wizardHidden");
|
paneEl.addClass("wizardHidden");
|
||||||
new Setting(paneEl).setClass("wizardHidden").autoWireToggle("batchSave");
|
new Setting(paneEl).setClass("wizardHidden").autoWireToggle("batchSave");
|
||||||
new Setting(paneEl).setClass("wizardHidden").autoWireNumeric("batchSaveMinimumDelay", {
|
new Setting(paneEl).setClass("wizardHidden").autoWireNumeric("batchSaveMinimumDelay", {
|
||||||
|
|||||||
Reference in New Issue
Block a user