From 98ab22479129e1a56a6708a392cdf7277618a762 Mon Sep 17 00:00:00 2001 From: midzelis Date: Mon, 29 Sep 2025 00:18:56 +0000 Subject: [PATCH] refactor: adjust favorite, delete, and archive actions for timeline - Pass TimelineManager instance to timeline action components instead of callbacks - Move asset update logic (delete, archive, favorite) into action components --- server/src/services/notification.service.ts | 19 +++++++++++- .../timeline/actions/ArchiveAction.svelte | 13 +++++--- .../actions/DeleteAssetsAction.svelte | 16 +++++++--- .../timeline/actions/FavoriteAction.svelte | 10 +++--- .../timeline-manager/day-group.svelte.ts | 2 +- .../lib/managers/timeline-manager/types.ts | 2 +- web/src/lib/utils/actions.ts | 6 ++-- .../[[assetId=id]]/+page.svelte | 28 +++++++---------- .../[[assetId=id]]/+page.svelte | 20 ++---------- .../[[assetId=id]]/+page.svelte | 14 ++------- .../[[assetId=id]]/+page.svelte | 31 +++++-------------- .../(user)/photos/[[assetId=id]]/+page.svelte | 17 ++-------- 12 files changed, 74 insertions(+), 104 deletions(-) diff --git a/server/src/services/notification.service.ts b/server/src/services/notification.service.ts index 91a043d405..8a1673b719 100644 --- a/server/src/services/notification.service.ts +++ b/server/src/services/notification.service.ts @@ -161,7 +161,24 @@ export class NotificationService extends BaseService { const [asset] = await this.assetRepository.getByIdsWithAllRelationsButStacks([assetId]); if (asset) { - this.eventRepository.clientSend('on_asset_update', userId, mapAsset(asset)); + // need to specify authDto to this mapAsset request, because it tries to prevent + // leaking information PR#7580 which expects a userId in the auth options object + this.eventRepository.clientSend( + 'on_asset_update', + userId, + mapAsset(asset, { + auth: { + user: { + id: userId, + isAdmin: false, + name: '', + email: '', + quotaUsageInBytes: 0, + quotaSizeInBytes: null, + }, + }, + }), + ); } } diff --git a/web/src/lib/components/timeline/actions/ArchiveAction.svelte b/web/src/lib/components/timeline/actions/ArchiveAction.svelte index 05ef9c99ff..de778981ca 100644 --- a/web/src/lib/components/timeline/actions/ArchiveAction.svelte +++ b/web/src/lib/components/timeline/actions/ArchiveAction.svelte @@ -1,5 +1,6 @@