From 709f92094c3fe451f6938f8faf5597da9edac8ab Mon Sep 17 00:00:00 2001 From: QuicksilverSlick Date: Mon, 9 Nov 2026 14:11:43 -0600 Subject: [PATCH] fix(desktop): keep the outsider notice to pasted keys After a key had been pasted once, the community roster stayed cached. A plain search or malformed key that matched nobody then showed "That key isn't a member of this community yet" instead of "No matching people or agents." The resolved check never required a parsed key, and the roster lookup for a null key is always false, so no key at all counted as an outsider. Require a parsed key before treating the lookup as resolved. Wording only: nothing could be added by mistake. Claude-Account: russelledeming@gmail.com Co-Authored-By: Claude Opus 5.5 --- .../features/channels/ui/MembersSidebar.tsx | 1 + desktop/tests/e2e/channels.spec.ts | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/desktop/src/features/channels/ui/MembersSidebar.tsx b/desktop/src/features/channels/ui/MembersSidebar.tsx index 9a4e56b363f..bfe1b5823c0 100644 --- a/desktop/src/features/channels/ui/MembersSidebar.tsx +++ b/desktop/src/features/channels/ui/MembersSidebar.tsx @@ -283,6 +283,7 @@ export function MembersSidebar({ ? pastedProfileQuery.data?.profiles[pastedPubkey] : undefined; const pastedKeyResolved = + pastedPubkey !== null && pastedProfileQuery.isSuccess && !pastedProfileQuery.isFetching && !rosterQuery.isLoading; diff --git a/desktop/tests/e2e/channels.spec.ts b/desktop/tests/e2e/channels.spec.ts index c193b09e97e..d7ea18dab1e 100644 --- a/desktop/tests/e2e/channels.spec.ts +++ b/desktop/tests/e2e/channels.spec.ts @@ -4787,6 +4787,26 @@ test("members sidebar offers nothing for a malformed key", async ({ page }) => { await expect(page.getByText("No matching people or agents.")).toBeVisible(); }); +test("members sidebar keeps the outsider notice to pasted keys once the roster is cached", async ({ + page, +}) => { + await page.goto("/"); + await openMembersSidebar(page, "general"); + + const search = page.getByTestId("channel-management-search-users"); + const outsiderNotice = page.getByText( + "That key isn’t a member of this community yet.", + ); + await search.fill(PASTED_NPUB); + await expect(outsiderNotice).toBeVisible(); + + await search.clear(); + await search.fill("zzzz-matches-nobody"); + + await expect(page.getByText("No matching people or agents.")).toBeVisible(); + await expect(outsiderNotice).toHaveCount(0); +}); + test("members sidebar pages add-member search beyond the first 50 people", async ({ page, }) => {