From c1186510e1bc57d3261e2c66b30295803427eb5d Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:49:34 -0400 Subject: [PATCH] Ensure access control hydrates cache synchronously --- js/accessControl.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/accessControl.js b/js/accessControl.js index 7a851bc6..54360164 100644 --- a/js/accessControl.js +++ b/js/accessControl.js @@ -130,6 +130,13 @@ class AccessControl { } }; + // Attempt a synchronous hydration so downstream consumers (like + // bootstrapTrustedSeeds) have immediate access to any cached admin + // state before they trigger refresh logic. This avoids a race where the + // async microtask hydration hasn't executed yet when those consumers + // call into `refresh()` and encounter an empty cache. + runHydrate(); + if (typeof queueMicrotask === "function") { queueMicrotask(runHydrate); return;