From b28956bbe777914440510d80ecc767cc8bebe9db Mon Sep 17 00:00:00 2001 From: RaymondVerhoef Date: Sun, 17 May 2026 15:27:34 +0200 Subject: [PATCH] feat: initialize PocketBase client with global auto-cancellation disabled and custom session expiry handling --- src/lib/pb.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/pb.js b/src/lib/pb.js index 6c82e7e..0f43bea 100644 --- a/src/lib/pb.js +++ b/src/lib/pb.js @@ -5,6 +5,9 @@ const pbUrl = import.meta.env.VITE_PB_URL || export const pb = new PocketBase(pbUrl); +// Globally disable auto cancellation to prevent React StrictMode from aborting requests +pb.autoCancellation(false); + // Detect auth portal session expiry: the portal returns HTML instead of JSON. // This prevents cryptic "Unexpected token '<'" errors when the session expires. pb.afterSend = function (response, data) {