Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: turn off sync push by default

Abdullah Atta9a0c12984413
diff --git a/packages/core/src/api/sync/index.js b/packages/core/src/api/sync/index.js
index c94dd5be1..0752a86de 100644
--- a/packages/core/src/api/sync/index.js
+++ b/packages/core/src/api/sync/index.js
@@ -293,39 +293,41 @@ class Sync {
}
async send(oldLastSynced, isForceSync, newLastSynced) {
- await this.uploadAttachments();
-
- let isSyncInitialized = false;
- let done = 0;
- for await (const item of this.collector.collect(
- 100,
- oldLastSynced,
- isForceSync
- )) {
- if (!isSyncInitialized) {
- const vaultKey = await this.db.vault._getKey();
- newLastSynced = await this.connection.invoke("InitializePush", {
- vaultKey,
- lastSynced: newLastSynced
- });
- isSyncInitialized = true;
- }
-
- const result = await this.pushItem(item, newLastSynced);
- if (result) {
- done += item.items.length;
- sendSyncProgressEvent(this.db.eventManager, "upload", done);
-
- this.logger.info(`Batch sent (${done})`);
- } else {
- this.logger.error(
- new Error(`Failed to send batch. Server returned falsy response.`)
- );
- }
- }
- if (!isSyncInitialized) return;
- await this.connection.invoke("SyncCompleted", newLastSynced);
- return true;
+ return false;
+
+ // await this.uploadAttachments();
+
+ // let isSyncInitialized = false;
+ // let done = 0;
+ // for await (const item of this.collector.collect(
+ // 100,
+ // oldLastSynced,
+ // isForceSync
+ // )) {
+ // if (!isSyncInitialized) {
+ // const vaultKey = await this.db.vault._getKey();
+ // newLastSynced = await this.connection.invoke("InitializePush", {
+ // vaultKey,
+ // lastSynced: newLastSynced
+ // });
+ // isSyncInitialized = true;
+ // }
+
+ // const result = await this.pushItem(item, newLastSynced);
+ // if (result) {
+ // done += item.items.length;
+ // sendSyncProgressEvent(this.db.eventManager, "upload", done);
+
+ // this.logger.info(`Batch sent (${done})`);
+ // } else {
+ // this.logger.error(
+ // new Error(`Failed to send batch. Server returned falsy response.`)
+ // );
+ // }
+ // }
+ // if (!isSyncInitialized) return;
+ // await this.connection.invoke("SyncCompleted", newLastSynced);
+ // return true;
}
async stop(lastSynced) {