From 25d12406060ad9ed9f90cc4d4fb0bfac75def720 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 20 Aug 2026 23:08:17 +0530 Subject: [PATCH] fix(permissions): tell a failed membership lookup apart from an empty one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A rejected request left the list undefined, which reads identically to a successful empty response, so the picker stated that the user belongs to no teams — and offered nothing to click, leaving Back and re-selecting the user as the only way to try again. The failure is now held separately from the list and rendered as its own state with a Retry, in both steps. In the user step it is checked ahead of the search branch, so a search that fails reports the failure rather than claiming the term matched nothing. --- src/lib/components/permissions/member.svelte | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/lib/components/permissions/member.svelte b/src/lib/components/permissions/member.svelte index c2064deec..cfa7c71d0 100644 --- a/src/lib/components/permissions/member.svelte +++ b/src/lib/components/permissions/member.svelte @@ -49,6 +49,10 @@ // order; only the newest request is allowed to write to the list or clear the spinner. let latestRequest = 0; + // Held separately from the lists: an empty list and a failed lookup both leave nothing to + // show, and reporting a failure as "none found" would be a lie the operator cannot act on. + let loadError = ''; + function clearUser() { user = null; memberships = undefined; @@ -72,6 +76,7 @@ if (!show || user) return; const requestId = ++latestRequest; isLoading = true; + loadError = ''; try { const response = await sdk .forProject(page.params.region, page.params.project) @@ -83,6 +88,7 @@ users = response; } catch (error) { if (requestId !== latestRequest) return; + loadError = error.message; addNotification({ type: 'error', message: error.message }); } finally { if (requestId === latestRequest) isLoading = false; @@ -94,6 +100,7 @@ const requestedUserId = user.$id; const requestId = ++latestRequest; isLoading = true; + loadError = ''; try { const response = await sdk .forProject(page.params.region, page.params.project) @@ -107,6 +114,7 @@ memberships = response; } catch (error) { if (requestId !== latestRequest) return; + loadError = error.message; addNotification({ type: 'error', message: error.message }); } finally { if (requestId === latestRequest) isLoading = false; @@ -210,6 +218,15 @@
+ {:else if loadError} + + + {loadError} + + + + + {:else} @@ -271,6 +288,20 @@ hidePages on:change={requestUsers} /> + {:else if loadError} + + + + + {loadError} + + + + + {:else if search}