From d6850756c69a02c5f73cef313ded7f70e22bc443 Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 9 Oct 2026 17:44:29 +0200 Subject: [PATCH] fix(settings): managed installs no longer offer photo providers or AirTrail on the phone On a managed install the phone's Integrations section still showed the Immich and Synology Photos cards and, with the addon on, the AirTrail connection form. Each asks for the address of a server the reader runs at home, which a managed install cannot reach, so saving or testing could only time out. The desktop has hidden both since the managed mode landed (#1946, 3a0604b3f), whose message says these "connect to a server the reader runs at home, and there is no route from here to one". That change gated the phone's AI section but missed these two, and the user facing addon list still carries a photo provider that was enabled before the switch, so the cards did render. The phone now applies the same !managed gate as the desktop IntegrationsTab. Regression test FE-MOB-SETINT-008 (MSettingsIntegrations.test.tsx) was red on the old code: "expected document not to contain element, found
instead". No existing assertion changed. --- .../mobile/screens/settings/MSettingsIntegrations.tsx | 9 +++++---- .../mobile/settings/MSettingsIntegrations.test.tsx | 11 +++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/client/src/mobile/screens/settings/MSettingsIntegrations.tsx b/client/src/mobile/screens/settings/MSettingsIntegrations.tsx index f35f204e1..f423da303 100644 --- a/client/src/mobile/screens/settings/MSettingsIntegrations.tsx +++ b/client/src/mobile/screens/settings/MSettingsIntegrations.tsx @@ -16,10 +16,11 @@ export default function MSettingsIntegrations() { return ( <> - - {airtrailEnabled && } - {/* Reaches a server the reader runs themselves, which a managed install has - no route to — the same gate the desktop shell puts on AirTrail. */} + {/* Immich, Synology Photos, AirTrail and Dawarich all reach a server the reader + runs themselves, which a managed install has no route to: the same gate the + desktop shell puts on them. */} + {!managed && } + {airtrailEnabled && !managed && } {dawarichEnabled && !managed && } {/* Which model reads a booking, and what that costs, comes with the instance on a managed install. The per-user fallback exists for people who supply their diff --git a/client/tests/unit/mobile/settings/MSettingsIntegrations.test.tsx b/client/tests/unit/mobile/settings/MSettingsIntegrations.test.tsx index f78690c9a..af4791a33 100644 --- a/client/tests/unit/mobile/settings/MSettingsIntegrations.test.tsx +++ b/client/tests/unit/mobile/settings/MSettingsIntegrations.test.tsx @@ -3,6 +3,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest'; import { render, screen } from '../../../helpers/render'; import { resetAllStores, seedStore } from '../../../helpers/store'; import { useAddonStore } from '../../../../src/store/addonStore'; +import { useAuthStore } from '../../../../src/store/authStore'; import MSettingsIntegrations from '../../../../src/mobile/screens/settings/MSettingsIntegrations'; // The four sections are covered by their own suites — stub them so this file @@ -94,4 +95,14 @@ describe('MSettingsIntegrations', () => { expect(loadAddons).toHaveBeenCalledTimes(1); }); + + it('FE-MOB-SETINT-008: a managed install hides the photo providers and AirTrail, as the desktop does', () => { + seedAddons(['airtrail', 'mcp']); + seedStore(useAuthStore, { managed: true }); + render(); + + expect(screen.queryByTestId('photo-providers')).not.toBeInTheDocument(); + expect(screen.queryByTestId('airtrail')).not.toBeInTheDocument(); + expect(screen.getByTestId('mcp')).toBeInTheDocument(); + }); });