From e0c408452d16ea818178d7384935937c70d51ab5 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Mon, 5 Jan 2026 21:28:00 +0100 Subject: [PATCH] fix(auth): await push token deletion before clearing API state on logout The DELETE request for removing the push token was not awaited, causing a race condition where setApi(null) could execute while the request was still in flight. This ensures proper sequencing. --- providers/JellyfinProvider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/JellyfinProvider.tsx b/providers/JellyfinProvider.tsx index 4bd7a431..f886d87a 100644 --- a/providers/JellyfinProvider.tsx +++ b/providers/JellyfinProvider.tsx @@ -289,7 +289,7 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({ const logoutMutation = useMutation({ mutationFn: async () => { - api + await api ?.delete(`/Streamyfin/device/${deviceId}`) .then((_r) => writeInfoLog("Deleted expo push token for device")) .catch((_e) =>