From dcde570ebe4cad5d930c8a91eb9c79eefe485829 Mon Sep 17 00:00:00 2001
From: Linus Rath <139418639+rathlinus@users.noreply.github.com>
Date: Mon, 26 Oct 2026 12:06:43 +0100
Subject: [PATCH] fix: say the directory can't be browsed instead of that a
refresh failed when the server lists only the people you know
---
.../__tests__/directory-picker-dialog.test.tsx | 10 ++++++++++
components/contacts/directory-browser.tsx | 7 ++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/components/contacts/__tests__/directory-picker-dialog.test.tsx b/components/contacts/__tests__/directory-picker-dialog.test.tsx
index bb4c719f7..192f8dc4b 100644
--- a/components/contacts/__tests__/directory-picker-dialog.test.tsx
+++ b/components/contacts/__tests__/directory-picker-dialog.test.tsx
@@ -98,4 +98,14 @@ describe('DirectoryPickerDialog', () => {
expect(rows()).toHaveLength(2);
expect(screen.getByRole('alert')).toHaveTextContent('refresh_failed');
});
+
+ // Stalwart 1.0 with directory queries off: the listing holds the principals
+ // the user knows (their own, their groups), and nothing failed.
+ it('says the directory is not browsable when it lists only the principals the user knows', () => {
+ setDirectory(people(1), 'forbidden');
+ render(
{t("refresh_failed")}
)} + {/* A refused listing (Stalwart 1.0 with directory queries off) still + holds the principals the user knows; nothing failed to refresh. */} + {entries.length > 0 && status === "forbidden" && ( +{t("forbidden_hint")}
+ )}