From c354538173a30a452a78f461d7b95333826b20cf Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Fri, 21 Aug 2026 10:03:08 +0530 Subject: [PATCH] fix(permissions): drop the membership request when stepping back MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Back only cleared the selected user; it left the membership request in flight and did not advance the request counter, so nothing invalidated it. On rejection the guard still matched, and the error landed on the user step — reporting "Could not load users." over a user list that had loaded fine, with a Retry that re-ran the wrong request. Back now invalidates the in-flight request and clears the error and spinner it owns. The rejection path also checks the selected user, so it matches the success path rather than relying on the counter alone. --- src/lib/components/permissions/member.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/components/permissions/member.svelte b/src/lib/components/permissions/member.svelte index cfa7c71d09..e57607672f 100644 --- a/src/lib/components/permissions/member.svelte +++ b/src/lib/components/permissions/member.svelte @@ -57,6 +57,12 @@ user = null; memberships = undefined; membershipOffset = 0; + + // Stepping back abandons the membership request. Leaving it live lets its rejection + // land on the user step and report the user list as the thing that failed. + latestRequest++; + loadError = ''; + isLoading = false; } function reset() { @@ -113,7 +119,7 @@ if (requestId !== latestRequest || user?.$id !== requestedUserId) return; memberships = response; } catch (error) { - if (requestId !== latestRequest) return; + if (requestId !== latestRequest || user?.$id !== requestedUserId) return; loadError = error.message; addNotification({ type: 'error', message: error.message }); } finally {