Skip to content

Build your personal knowledge base with Trilium Notes

chore(resources): leave download progress out of the broadcast log

Elian Doran89b0513b3118
diff --git a/packages/trilium-core/src/services/messaging/index.spec.ts b/packages/trilium-core/src/services/messaging/index.spec.ts
index 1c7dd5a083..07c177fe80 100644
--- a/packages/trilium-core/src/services/messaging/index.spec.ts
+++ b/packages/trilium-core/src/services/messaging/index.spec.ts
@@ -53,6 +53,7 @@ describe("messaging provider (core)", () => {
expect(shouldLogMessage({ type: "ping" } as WebSocketMessage)).toBe(false);
expect(shouldLogMessage({ type: "sync-failed" } as WebSocketMessage)).toBe(false);
expect(shouldLogMessage({ type: "api-log-messages" } as WebSocketMessage)).toBe(false);
+ expect(shouldLogMessage({ type: "resource-download" } as WebSocketMessage)).toBe(false);
expect(shouldLogMessage({ type: "sync-finished" } as WebSocketMessage)).toBe(true);
expect(shouldLogMessage({ type: "reload-frontend" } as WebSocketMessage)).toBe(true);
diff --git a/packages/trilium-core/src/services/messaging/index.ts b/packages/trilium-core/src/services/messaging/index.ts
index c0a18ea4e4..c44911c563 100644
--- a/packages/trilium-core/src/services/messaging/index.ts
+++ b/packages/trilium-core/src/services/messaging/index.ts
@@ -49,7 +49,9 @@ export function sendMessageToAllClients(message: WebSocketMessage): void {
* recursively log API log output, and "sync-failed" repeats on every failed
* sync attempt.
*/
-const UNLOGGED_MESSAGE_TYPES = new Set<WebSocketMessage["type"]>(["frontend-update", "ping", "sync-failed", "api-log-messages"]);
+const UNLOGGED_MESSAGE_TYPES = new Set<WebSocketMessage["type"]>([
+ "frontend-update", "ping", "sync-failed", "api-log-messages", "resource-download"
+]);
/**
* Whether a broadcast message should be logged by the messaging provider,