Skip to content

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

chore: remove all comments

thecodrr6fab9ad1f303
diff --git a/packages/core/__e2e__/usermanager.test.skip.js b/packages/core/__e2e__/usermanager.test.skip.js
index 847ffb2b5..10c2a1f4a 100644
--- a/packages/core/__e2e__/usermanager.test.skip.js
+++ b/packages/core/__e2e__/usermanager.test.skip.js
@@ -28,7 +28,6 @@ test.skip("login user and check for token", async () => {
usermanager.login(user.email, user.password)
).resolves.not.toThrow();
- console.log(await usermanager.tokenManager.getToken());
await expect(usermanager.tokenManager.getToken()).resolves.toBeDefined();
}, 30000);
@@ -39,7 +38,6 @@ test.skip("login user and get user data", async () => {
await usermanager.login(user.email, user.password);
const userData = await usermanager.getUser();
- console.log(userData);
expect(userData.email).toBe(process.env.EMAIL);
}, 30000);
diff --git a/packages/core/__tests__/topics.test.js b/packages/core/__tests__/topics.test.js
index 5eccf1149..9fdc29286 100644
--- a/packages/core/__tests__/topics.test.js
+++ b/packages/core/__tests__/topics.test.js
@@ -135,7 +135,6 @@ test("editing one topic should not update dateEdited of all", () =>
const newTopics = topics.all.filter((t) => t.title !== "Hello22");
- //console.log(newTopics, oldTopics);
expect(
newTopics.every(
(t) =>
diff --git a/packages/core/api/index.js b/packages/core/api/index.js
index 694c4d79e..782adb97b 100644
--- a/packages/core/api/index.js
+++ b/packages/core/api/index.js
@@ -56,7 +56,6 @@ class Database {
this
);
EV.subscribe(EVENTS.attachmentDeleted, async (attachment) => {
- console.log("deleted:", attachment);
await this.fs.cancel(attachment.metadata.hash);
});
EV.subscribe(EVENTS.userLoggedOut, async () => {
@@ -140,7 +139,7 @@ class Database {
try {
var { type, data } = JSON.parse(event.data);
data = JSON.parse(data);
- console.log(type, data);
+ // console.log(type, data);
} catch (e) {
console.log("SSE: Unsupported message. Message = ", event.data);
return;
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index cbafe9f70..5dc5e7668 100644
--- a/packages/core/api/sync/index.js
+++ b/packages/core/api/sync/index.js
@@ -152,7 +152,6 @@ export default class Sync {
async _uploadAttachments() {
const attachments = this._db.attachments.pending;
try {
- console.log("Uploading attachments", this._db.attachments.pending);
for (var i = 0; i < attachments.length; ++i) {
const attachment = attachments[i];
const { hash } = attachment.metadata;
diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js
index 75e8b9856..907440df9 100644
--- a/packages/core/collections/attachments.js
+++ b/packages/core/collections/attachments.js
@@ -88,7 +88,6 @@ export default class Attachments extends Collection {
dateUploaded: undefined,
dateDeleted: undefined,
};
- console.log("adding attachmentitem", attachmentItem);
return this._collection.addItem(attachmentItem);
}
@@ -155,7 +154,6 @@ export default class Attachments extends Collection {
markAsUploaded(id) {
const attachment = this.all.find((a) => a.id === id);
- console.log("mark as uploaded", id, attachment);
if (!attachment) return;
attachment.dateUploaded = Date.now();
return this._collection.updateItem(attachment);
@@ -174,38 +172,36 @@ export default class Attachments extends Collection {
const attachments = this.images.filter((attachment) =>
hasItem(attachment.noteIds, noteId)
);
- console.log("Downloading attachments", attachments);
- for (let i = 0; i < attachments.length; i++) {
- const { hash } = attachments[i].metadata;
- await this._downloadMedia(hash, {
- total: attachments.length,
- current: i,
- groupId: noteId,
- });
+ try {
+ for (let i = 0; i < attachments.length; i++) {
+ const { hash } = attachments[i].metadata;
+ await this._downloadMedia(hash, {
+ total: attachments.length,
+ current: i,
+ groupId: noteId,
+ });
+ }
+ } finally {
+ sendAttachmentsProgressEvent("download", noteId, attachments.length);
}
}
async _downloadMedia(hash, { total, current, groupId }, notify = true) {
sendAttachmentsProgressEvent("download", groupId, total, current);
- try {
- const isDownloaded = await this._db.fs.downloadFile(groupId, hash);
- if (!isDownloaded) return;
+ const isDownloaded = await this._db.fs.downloadFile(groupId, hash);
+ if (!isDownloaded) return;
- const src = await this.read(hash);
- if (!src) return;
+ const src = await this.read(hash);
+ if (!src) return;
- if (notify)
- EV.publish(EVENTS.mediaAttachmentDownloaded, {
- groupId,
- hash,
- src,
- });
+ if (notify)
+ EV.publish(EVENTS.mediaAttachmentDownloaded, {
+ groupId,
+ hash,
+ src,
+ });
- return src;
- } finally {
- if (1 + current === total)
- sendAttachmentsProgressEvent("download", groupId, total);
- }
+ return src;
}
async cleanup() {
diff --git a/packages/core/database/fs.js b/packages/core/database/fs.js
index 287ebc622..8c4dfe9ca 100644
--- a/packages/core/database/fs.js
+++ b/packages/core/database/fs.js
@@ -35,11 +35,9 @@ export default class FileStorage {
}
async cancel(groupId, type = undefined) {
- console.trace("Cancelling", groupId, type);
const [op] = this._deleteOp(groupId, type);
if (!op) return;
await op.cancel("Operation canceled.");
- console.log("Cancellation done:", groupId, this._queue);
}
_deleteOp(groupId, type = undefined) {