1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

All: Added feature flags to disable Joplin Server sync optimisations by default, so that it still work with server 2.0

This commit is contained in:
Laurent Cozic 2021-06-19 14:22:53 +01:00
parent 7aff6d271d
commit 326fef486c
3 changed files with 19 additions and 3 deletions

View File

@ -378,7 +378,7 @@ export default class Synchronizer {
this.dispatch({ type: 'SYNC_STARTED' });
eventManager.emit('syncStart');
this.logSyncOperation('starting', null, null, `Starting synchronisation to target ${syncTargetId}... [${synchronizationId}]`);
this.logSyncOperation('starting', null, null, `Starting synchronisation to target ${syncTargetId}... supportsAccurateTimestamp = ${this.api().supportsAccurateTimestamp}; supportsMultiPut = ${this.api().supportsMultiPut} [${synchronizationId}]`);
const handleCannotSyncItem = async (ItemClass: any, syncTargetId: any, item: any, cannotSyncReason: string, itemLocation: any = null) => {
await ItemClass.saveSyncDisabled(syncTargetId, item, cannotSyncReason, itemLocation);

View File

@ -1,6 +1,7 @@
import { MultiPutItem } from './file-api';
import JoplinError from './JoplinError';
import JoplinServerApi from './JoplinServerApi';
import Setting from './models/Setting';
import { trimSlashes } from './path-utils';
// All input paths should be in the format: "path/to/file". This is converted to
@ -33,11 +34,11 @@ export default class FileApiDriverJoplinServer {
}
public get supportsMultiPut() {
return true;
return Setting.value('featureFlag.syncMultiPut');
}
public get supportsAccurateTimestamp() {
return true;
return Setting.value('featureFlag.syncAccurateTimestamps');
}
public requestRepeatCount() {

View File

@ -1242,6 +1242,21 @@ class Setting extends BaseModel {
appTypes: ['desktop'],
storage: SettingStorage.Database,
},
'featureFlag.syncAccurateTimestamps': {
value: false,
type: SettingItemType.Bool,
public: false,
storage: SettingStorage.File,
},
'featureFlag.syncMultiPut': {
value: false,
type: SettingItemType.Bool,
public: false,
storage: SettingStorage.File,
},
};
this.metadata_ = Object.assign(this.metadata_, this.customMetadata_);