mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-13 01:35:57 +00:00
### Fixed
- We are now able to enable optional features correctly again (#732). - No longer oversized files have been processed, furthermore. - Before creating a chunk, the file is verified as the target. - The behaviour upon receiving replication has been changed as follows: - If the remote file is oversized, it is ignored. - If not, but while the local file is oversized, it is also ignored.
This commit is contained in:
@@ -1741,7 +1741,7 @@ export class ConfigSync extends LiveSyncCommands {
|
|||||||
return Promise.resolve(true);
|
return Promise.resolve(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _anyConfigureOptionalSyncFeature(mode: keyof OPTIONAL_SYNC_FEATURES) {
|
private async _allConfigureOptionalSyncFeature(mode: keyof OPTIONAL_SYNC_FEATURES) {
|
||||||
await this.configureHiddenFileSync(mode);
|
await this.configureHiddenFileSync(mode);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1813,6 +1813,6 @@ export class ConfigSync extends LiveSyncCommands {
|
|||||||
services.databaseEvents.handleDatabaseInitialised(this._everyOnDatabaseInitialized.bind(this));
|
services.databaseEvents.handleDatabaseInitialised(this._everyOnDatabaseInitialized.bind(this));
|
||||||
services.setting.handleSuspendExtraSync(this._allSuspendExtraSync.bind(this));
|
services.setting.handleSuspendExtraSync(this._allSuspendExtraSync.bind(this));
|
||||||
services.setting.handleSuggestOptionalFeatures(this._allAskUsingOptionalSyncFeature.bind(this));
|
services.setting.handleSuggestOptionalFeatures(this._allAskUsingOptionalSyncFeature.bind(this));
|
||||||
services.setting.handleEnableOptionalFeature(this._anyConfigureOptionalSyncFeature.bind(this));
|
services.setting.handleEnableOptionalFeature(this._allConfigureOptionalSyncFeature.bind(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1657,7 +1657,7 @@ ${messageFetch}${messageOverwrite}${messageMerge}
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --> Configuration handling
|
// --> Configuration handling
|
||||||
private async _anyConfigureOptionalSyncFeature(mode: keyof OPTIONAL_SYNC_FEATURES) {
|
private async _allConfigureOptionalSyncFeature(mode: keyof OPTIONAL_SYNC_FEATURES) {
|
||||||
await this.configureHiddenFileSync(mode);
|
await this.configureHiddenFileSync(mode);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1805,6 +1805,6 @@ ${messageFetch}${messageOverwrite}${messageMerge}
|
|||||||
services.databaseEvents.handleDatabaseInitialised(this._everyOnDatabaseInitialized.bind(this));
|
services.databaseEvents.handleDatabaseInitialised(this._everyOnDatabaseInitialized.bind(this));
|
||||||
services.setting.handleSuspendExtraSync(this._allSuspendExtraSync.bind(this));
|
services.setting.handleSuspendExtraSync(this._allSuspendExtraSync.bind(this));
|
||||||
services.setting.handleSuggestOptionalFeatures(this._allAskUsingOptionalSyncFeature.bind(this));
|
services.setting.handleSuggestOptionalFeatures(this._allAskUsingOptionalSyncFeature.bind(this));
|
||||||
services.setting.handleEnableOptionalFeature(this._anyConfigureOptionalSyncFeature.bind(this));
|
services.setting.handleEnableOptionalFeature(this._allConfigureOptionalSyncFeature.bind(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
src/lib
2
src/lib
Submodule src/lib updated: 422194fb1b...8fee5ee0b7
@@ -353,6 +353,10 @@ export class ModuleFileHandler extends AbstractModule {
|
|||||||
this._log(`File ${entry.path} is not the target file`, LOG_LEVEL_VERBOSE);
|
this._log(`File ${entry.path} is not the target file`, LOG_LEVEL_VERBOSE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (this.services.vault.isFileSizeTooLarge(entry.size)) {
|
||||||
|
this._log(`File ${entry.path} is too large (on database) to be processed`, LOG_LEVEL_VERBOSE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (shouldBeIgnored(entry.path)) {
|
if (shouldBeIgnored(entry.path)) {
|
||||||
this._log(`File ${entry.path} should be ignored`, LOG_LEVEL_VERBOSE);
|
this._log(`File ${entry.path} should be ignored`, LOG_LEVEL_VERBOSE);
|
||||||
return false;
|
return false;
|
||||||
@@ -365,6 +369,10 @@ export class ModuleFileHandler extends AbstractModule {
|
|||||||
// Nothing to do and other modules should also nothing to do.
|
// Nothing to do and other modules should also nothing to do.
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
if (targetFile && this.services.vault.isFileSizeTooLarge(targetFile.stat.size)) {
|
||||||
|
this._log(`File ${targetFile.path} is too large (on storage) to be processed`, LOG_LEVEL_VERBOSE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
this._log(
|
this._log(
|
||||||
`Processing ${path} (${entry._id.substring(0, 8)} :${entry._rev?.substring(0, 5)}) : Started...`,
|
`Processing ${path} (${entry._id.substring(0, 8)} :${entry._rev?.substring(0, 5)}) : Started...`,
|
||||||
LOG_LEVEL_VERBOSE
|
LOG_LEVEL_VERBOSE
|
||||||
@@ -399,6 +407,10 @@ export class ModuleFileHandler extends AbstractModule {
|
|||||||
incProcessed();
|
incProcessed();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (this.services.vault.isFileSizeTooLarge(file.stat.size)) {
|
||||||
|
incProcessed();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (shouldBeIgnored(file.path)) {
|
if (shouldBeIgnored(file.path)) {
|
||||||
incProcessed();
|
incProcessed();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user