mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-07 18:02:30 +00:00
Apply received changes again while remediation mode is active
Remediation mode prevents the reconciliation scan which readiness depends upon, so the application never becomes ready while the modification-time limit is set. Since the result processor began waiting for readiness, nothing was applied in that mode at all, not even changes older than the limit, which is what the mode exists for. Result application no longer requires readiness while the limit is configured, but it does require a usable local database, because a change applied while a fetch has reset the database cannot gather its chunks and is dropped. The limit itself is still enforced for every change. A scheduled fetch also no longer offers Simple Fetch in this mode. Simple Fetch reconciles the Vault with the local database after fetching, past the check which refuses that scan, so it could store the current files or write changes newer than the limit. The detailed flow states the restriction and offers to clear it first.
This commit is contained in:
@@ -190,6 +190,20 @@ export async function askAndPerformFastSetupOnScheduledFetchAll(
|
||||
log: LogFunction,
|
||||
cleanupFlag: () => Promise<void>
|
||||
): Promise<boolean | undefined> {
|
||||
if (host.services.setting.currentSettings().maxMTimeForReflectEvents > 0) {
|
||||
// Simple Fetch reconciles storage with the local database after fetching, past the check which
|
||||
// refuses that scan in remediation mode. Skipping only the scan would restore nothing from most
|
||||
// remotes: reflection of received documents stays suspended while Simple Fetch fetches, so Object
|
||||
// Storage and P2P remotes discard them, and CouchDB Fast Fetch writes them straight into the
|
||||
// database. The detailed flow at least states the restriction and offers to clear it before
|
||||
// rebuilding, instead of quietly reconciling past it.
|
||||
log(
|
||||
"Remediation mode is active, so the detailed fetch flow is used instead of Simple Fetch.",
|
||||
LOG_LEVEL_NOTICE
|
||||
);
|
||||
clearRememberedSimpleFetchMode(host);
|
||||
return undefined;
|
||||
}
|
||||
const result = await askSimpleFetchMode(host);
|
||||
if (result === "cancelled") {
|
||||
log("Fetch cancelled by user.", LOG_LEVEL_NOTICE);
|
||||
|
||||
Reference in New Issue
Block a user