Skip to content

Build your personal knowledge base with Trilium Notes

removed event log

zadam5d80df398bae
diff --git a/db/migrations/0143__drop_event_log.sql b/db/migrations/0143__drop_event_log.sql
new file mode 100644
index 0000000000..3996548c5c
--- /dev/null
+++ b/db/migrations/0143__drop_event_log.sql
@@ -0,0 +1 @@
+DROP TABLE event_log;
\ No newline at end of file
diff --git a/src/public/javascripts/dialogs/event_log.js b/src/public/javascripts/dialogs/event_log.js
deleted file mode 100644
index 89ae2ede10..0000000000
--- a/src/public/javascripts/dialogs/event_log.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import linkService from '../services/link.js';
-import utils from '../services/utils.js';
-import server from '../services/server.js';
-
-const $dialog = $("#event-log-dialog");
-const $list = $("#event-log-list");
-
-export async function showDialog() {
- utils.closeActiveDialog();
-
- glob.activeDialog = $dialog;
-
- $dialog.modal();
-
- const result = await server.get('event-log');
-
- $list.empty();
-
- for (const event of result) {
- const dateTime = utils.formatDateTime(utils.parseDate(event.utcDateCreated));
-
- if (event.noteId) {
- const noteLink = await linkService.createNoteLink(event.noteId).prop('outerHTML');
-
- event.comment = event.comment.replace('<note>', noteLink);
- }
-
- const eventEl = $('<li>').html(dateTime + " - " + event.comment);
-
- $list.append(eventEl);
- }
-}
\ No newline at end of file
diff --git a/src/routes/api/event_log.js b/src/routes/api/event_log.js
deleted file mode 100644
index 8503503404..0000000000
--- a/src/routes/api/event_log.js
+++ /dev/null
@@ -1,11 +0,0 @@
-"use strict";
-
-const sql = require('../../services/sql');
-
-async function getEventLog() {
- return await sql.getRows("SELECT * FROM event_log ORDER BY utcDateCreated DESC");
-}
-
-module.exports = {
- getEventLog
-};
\ No newline at end of file
diff --git a/src/routes/routes.js b/src/routes/routes.js
index e772d87b61..bd5fc8c05c 100644
--- a/src/routes/routes.js
+++ b/src/routes/routes.js
@@ -16,7 +16,6 @@ const optionsApiRoute = require('./api/options');
const passwordApiRoute = require('./api/password');
const syncApiRoute = require('./api/sync');
const loginApiRoute = require('./api/login');
-const eventLogRoute = require('./api/event_log');
const recentNotesRoute = require('./api/recent_notes');
const appInfoRoute = require('./api/app_info');
const exportRoute = require('./api/export');
@@ -189,8 +188,6 @@ function register(app) {
route(POST, '/api/sync/finished', [auth.checkApiAuth], syncApiRoute.syncFinished, apiResultHandler);
route(GET, '/api/sync/stats', [], syncApiRoute.getStats, apiResultHandler);
- apiRoute(GET, '/api/event-log', eventLogRoute.getEventLog);
-
apiRoute(POST, '/api/recent-notes', recentNotesRoute.addRecentNote);
apiRoute(GET, '/api/app-info', appInfoRoute.getAppInfo);
diff --git a/src/services/app_info.js b/src/services/app_info.js
index d1eb342322..671c7a1b0a 100644
--- a/src/services/app_info.js
+++ b/src/services/app_info.js
@@ -4,7 +4,7 @@ const build = require('./build');
const packageJson = require('../../package');
const {TRILIUM_DATA_DIR} = require('./data_dir');
-const APP_DB_VERSION = 142;
+const APP_DB_VERSION = 143;
const SYNC_VERSION = 10;
const CLIPPER_PROTOCOL_VERSION = "1.0";
diff --git a/src/services/content_hash.js b/src/services/content_hash.js
index e1ffc29ce3..0571acb824 100644
--- a/src/services/content_hash.js
+++ b/src/services/content_hash.js
@@ -3,7 +3,6 @@
const sql = require('./sql');
const utils = require('./utils');
const log = require('./log');
-const eventLogService = require('./event_log');
const ws = require('./ws.js');
const ApiToken = require('../entities/api_token');
const Branch = require('../entities/branch');
@@ -56,8 +55,6 @@ async function checkContentHashes(otherHashes) {
if (hashes[key] !== otherHashes[key]) {
allChecksPassed = false;
- await eventLogService.addEvent(`Content hash check for ${key} FAILED. Local is ${hashes[key]}, remote is ${otherHashes[key]}`);
-
if (key !== 'recent_notes') {
// let's not get alarmed about recent notes which get updated often and can cause failures in race conditions
await ws.sendMessageToAllClients({type: 'sync-hash-check-failed'});
diff --git a/src/services/event_log.js b/src/services/event_log.js
deleted file mode 100644
index ca691f17a7..0000000000
--- a/src/services/event_log.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const sql = require('./sql');
-const dateUtils = require('./date_utils');
-const utils = require('./utils');
-const log = require('./log');
-
-async function addEvent(comment) {
- await addNoteEvent(null, comment);
-}
-
-async function addNoteEvent(noteId, comment) {
- await sql.insert('event_log', {
- eventId: utils.newEntityId(),
- noteId : noteId,
- comment: comment,
- utcDateCreated: dateUtils.utcNowDateTime()
- });
-
- log.info("Event log for " + noteId + ": " + comment);
-}
-
-module.exports = {
- addEvent
-};
\ No newline at end of file
diff --git a/src/services/sync_update.js b/src/services/sync_update.js
index 5779bbf34c..9b5e423310 100644
--- a/src/services/sync_update.js
+++ b/src/services/sync_update.js
@@ -1,6 +1,5 @@
const sql = require('./sql');
const log = require('./log');
-const eventLogService = require('./event_log');
const syncTableService = require('./sync_table');
const eventService = require('./events');
@@ -138,8 +137,6 @@ async function updateOptions(entity, sourceId) {
await sql.replace('options', entity);
await syncTableService.addOptionsSync(entity.name, sourceId);
-
- await eventLogService.addEvent("Synced option " + entity.name);
}
});
}
diff --git a/src/views/desktop.ejs b/src/views/desktop.ejs
index 9a33ef8cc3..91b949624e 100644
--- a/src/views/desktop.ejs
+++ b/src/views/desktop.ejs
@@ -156,7 +156,6 @@
<% include dialogs/add_link.ejs %>
<% include dialogs/attributes.ejs %>
<% include dialogs/branch_prefix.ejs %>
- <% include dialogs/event_log.ejs %>
<% include dialogs/export.ejs %>
<% include dialogs/import.ejs %>
<% include dialogs/jump_to_note.ejs %>
diff --git a/src/views/dialogs/event_log.ejs b/src/views/dialogs/event_log.ejs
deleted file mode 100644
index fbc7f718e7..0000000000
--- a/src/views/dialogs/event_log.ejs
+++ /dev/null
@@ -1,15 +0,0 @@
-<div id="event-log-dialog" class="modal fade mx-auto" tabindex="-1" role="dialog">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">Event log</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">&times;</span>
- </button>
- </div>
- <div class="modal-body">
- <ul id="event-log-list"></ul>
- </div>
- </div>
- </div>
-</div>