Ensure access control hydrates cache synchronously

This commit is contained in:
thePR0M3TH3AN committed 2025-10-27 17:49:34 -04:00
1 parent c3bf0dc5bf
commit c1186510e1
1 file changed
+7
+7
View File
@@ -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;