From f3bc3c58d117effc1362ccd65b72116233b43335 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 26 Oct 2025 14:00:45 +0000 Subject: [PATCH] Use original timestamps for pull events --- .../obsidian-plugin/src/views/history/history-view.scss | 2 +- .../src/sync-operations/unrestricted-syncer.ts | 9 ++++++--- frontend/sync-client/src/tracing/sync-history.ts | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/obsidian-plugin/src/views/history/history-view.scss b/frontend/obsidian-plugin/src/views/history/history-view.scss index 13e24594..df307db7 100644 --- a/frontend/obsidian-plugin/src/views/history/history-view.scss +++ b/frontend/obsidian-plugin/src/views/history/history-view.scss @@ -4,7 +4,7 @@ background-color: var(--color-base-00); border-radius: var(--radius-l); container-type: inline-size; - word-break: break-all; + word-break: break-word; &.clickable { cursor: pointer; diff --git a/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts b/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts index 0d0f45ef..1f7e908c 100644 --- a/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts +++ b/frontend/sync-client/src/sync-operations/unrestricted-syncer.ts @@ -228,7 +228,8 @@ export class UnrestrictedSyncer { }, message: "File has been deleted remotely, so we deleted it locally", - author: response.userId + author: response.userId, + timestamp: new Date(response.updatedDate) }); this.database.delete(document.relativePath); @@ -325,7 +326,8 @@ export class UnrestrictedSyncer { status: SyncStatus.SUCCESS, details: actualUpdateDetails, message: `Successfully downloaded remotely updated file from the server`, - author: response.userId + author: response.userId, + timestamp: new Date(response.updatedDate) }); } }); @@ -429,7 +431,8 @@ export class UnrestrictedSyncer { status: SyncStatus.SUCCESS, details: updateDetails, message: `Successfully downloaded remote file which hadn't existed locally`, - author: remoteVersion.userId + author: remoteVersion.userId, + timestamp: new Date(remoteVersion.updatedDate) }); }); } diff --git a/frontend/sync-client/src/tracing/sync-history.ts b/frontend/sync-client/src/tracing/sync-history.ts index 6890688b..92904ce6 100644 --- a/frontend/sync-client/src/tracing/sync-history.ts +++ b/frontend/sync-client/src/tracing/sync-history.ts @@ -39,6 +39,7 @@ export interface CommonHistoryEntry { message: string; details: SyncDetails; author?: string; + timestamp?: Date; } export enum SyncType { @@ -92,7 +93,7 @@ export class SyncHistory { public addHistoryEntry(entry: CommonHistoryEntry): void { const historyEntry = { ...entry, - timestamp: new Date() + timestamp: entry.timestamp ?? new Date() }; const candidate = this.findSimilarRecentUpdateEntry(historyEntry);