From 7968ca0d3cc72af4e7c69502d0e9f3d356da1eeb Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Wed, 27 May 2026 04:24:02 +0000 Subject: [PATCH] Fixes for CI failures --- mobile/openapi/lib/api/activities_api.dart | 4 ++-- open-api/immich-openapi-specs.json | 6 ----- server/src/services/activity.service.spec.ts | 12 +++------- .../asset-viewer/ActivityViewer.svelte | 22 ++++++++++++------- .../lib/managers/activity-manager.svelte.ts | 6 +++-- 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/mobile/openapi/lib/api/activities_api.dart b/mobile/openapi/lib/api/activities_api.dart index e2a85e7ad9..85a245be45 100644 --- a/mobile/openapi/lib/api/activities_api.dart +++ b/mobile/openapi/lib/api/activities_api.dart @@ -141,7 +141,7 @@ class ActivitiesApi { /// * [ReactionLevel] level: /// /// * [int] take: - /// Maximum number of activities to return + /// Approximate maximum number of activities to return. The response may exceed this value to include all activities sharing the oldest returned timestamp, preserving pagination boundaries. /// /// * [ReactionType] type: /// @@ -210,7 +210,7 @@ class ActivitiesApi { /// * [ReactionLevel] level: /// /// * [int] take: - /// Maximum number of activities to return + /// Approximate maximum number of activities to return. The response may exceed this value to include all activities sharing the oldest returned timestamp, preserving pagination boundaries. /// /// * [ReactionType] type: /// diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 7a12116bf6..703c0b363b 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -33,9 +33,6 @@ "required": false, "in": "query", "description": "Return activities created before this date (for pagination)", - "x-nestjs_zod-parent-metadata": { - "description": "Activity search" - }, "schema": { "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$", @@ -56,9 +53,6 @@ "required": false, "in": "query", "description": "Approximate maximum number of activities to return. The response may exceed this value to include all activities sharing the oldest returned timestamp, preserving pagination boundaries.", - "x-nestjs_zod-parent-metadata": { - "description": "Activity search" - }, "schema": { "minimum": 1, "maximum": 1000, diff --git a/server/src/services/activity.service.spec.ts b/server/src/services/activity.service.spec.ts index e4576f0460..9523208c35 100644 --- a/server/src/services/activity.service.spec.ts +++ b/server/src/services/activity.service.spec.ts @@ -151,9 +151,7 @@ describe(ActivityService.name, () => { await sut.getAll(AuthFactory.create(), { albumId, take: 2, before }); - expect(mocks.activity.search).toHaveBeenCalledWith( - expect.objectContaining({ albumId, take: 2, before }), - ); + expect(mocks.activity.search).toHaveBeenCalledWith(expect.objectContaining({ albumId, take: 2, before })); }); it('should query boundary with at parameter', async () => { @@ -162,15 +160,11 @@ describe(ActivityService.name, () => { const a1 = ActivityFactory.create({ albumId, createdAt: boundaryTime }); mocks.access.album.checkOwnerAccess.mockResolvedValue(new Set([albumId])); - mocks.activity.search - .mockResolvedValueOnce([a1]) - .mockResolvedValueOnce([a1]); + mocks.activity.search.mockResolvedValueOnce([a1]).mockResolvedValueOnce([a1]); await sut.getAll(AuthFactory.create(), { albumId, take: 2 }); - expect(mocks.activity.search).toHaveBeenCalledWith( - expect.objectContaining({ at: boundaryTime }), - ); + expect(mocks.activity.search).toHaveBeenCalledWith(expect.objectContaining({ at: boundaryTime })); }); }); diff --git a/web/src/lib/components/asset-viewer/ActivityViewer.svelte b/web/src/lib/components/asset-viewer/ActivityViewer.svelte index 5fb529b341..4662713f2e 100644 --- a/web/src/lib/components/asset-viewer/ActivityViewer.svelte +++ b/web/src/lib/components/asset-viewer/ActivityViewer.svelte @@ -68,9 +68,9 @@ hour12: false, }; - const handleDeleteReaction = async (reaction: ActivityResponseDto, index: number) => { + const handleDeleteReaction = async (reaction: ActivityResponseDto) => { try { - await activityManager.deleteActivity(reaction, index); + await activityManager.deleteActivity(reaction); const deleteMessages: Record = { [ReactionType.Comment]: $t('comment_deleted'), @@ -119,7 +119,9 @@ }); const loadMoreAndPreserveScroll = async () => { - if (!scrollContainer) return; + if (!scrollContainer) { + return; + } const prevScrollHeight = scrollContainer.scrollHeight; const prevScrollTop = scrollContainer.scrollTop; await activityManager.loadMore(); @@ -130,7 +132,9 @@ }; const onScrollContainer = () => { - if (isAdjustingScroll || !scrollContainer || activityManager.isLoadingMore || !activityManager.hasMore) return; + if (isAdjustingScroll || !scrollContainer || activityManager.isLoadingMore || !activityManager.hasMore) { + return; + } if (scrollContainer.scrollTop < 200) { void loadMoreAndPreserveScroll(); } @@ -142,9 +146,11 @@ void activityManager.activities.length; void activityManager.isLoadingMore; - if (!scrollContainer || !activityManager.hasMore || activityManager.isLoadingMore) return; + if (!scrollContainer || !activityManager.hasMore || activityManager.isLoadingMore) { + return; + } // After rendering, check if there's no scrollable overflow - tick().then(() => { + void tick().then(() => { if (scrollContainer && scrollContainer.scrollHeight <= scrollContainer.clientHeight) { void loadMoreAndPreserveScroll(); } @@ -215,7 +221,7 @@ activeColor="bg-red-200" icon={mdiDeleteOutline} text={$t('remove')} - onClick={() => handleDeleteReaction(reaction, index)} + onClick={() => handleDeleteReaction(reaction)} /> @@ -265,7 +271,7 @@ activeColor="bg-red-200" icon={mdiDeleteOutline} text={$t('remove')} - onClick={() => handleDeleteReaction(reaction, index)} + onClick={() => handleDeleteReaction(reaction)} /> diff --git a/web/src/lib/managers/activity-manager.svelte.ts b/web/src/lib/managers/activity-manager.svelte.ts index ea0a855000..24ada8c010 100644 --- a/web/src/lib/managers/activity-manager.svelte.ts +++ b/web/src/lib/managers/activity-manager.svelte.ts @@ -27,7 +27,9 @@ function waitForServerVersion(): Promise<{ major: number; minor: number; patch: return new Promise((resolve) => { let settled = false; const finish = (version: { major: number; minor: number; patch: number } | undefined) => { - if (settled) return; + if (settled) { + return; + } settled = true; try { clearTimeout(timer); @@ -148,7 +150,7 @@ class ActivityManager { return activity; } - async deleteActivity(activity: ActivityResponseDto, index?: number) { + async deleteActivity(activity: ActivityResponseDto) { if (!this.#albumId) { return; }