-
{t("Measured size")}
+
+ {t(showingInitial ? "Scanned size" : "Measured size")}
+
{niceBytes(String(summary.sizeBytes))}
@@ -80,7 +91,9 @@ export function BucketUsageOverview({
)}
{summary.objectsCount !== undefined && (
-
{t("Measured objects")}
+
+ {t(showingInitial ? "Scanned objects" : "Measured objects")}
+
{formatInteger(summary.objectsCount)}
@@ -101,7 +114,7 @@ export function BucketUsageOverview({
{hasValues && (
- {coverage}
+ {showingInitial ? t("Initial statistics") : coverage}
)}
diff --git a/hooks/use-permissions.tsx b/hooks/use-permissions.tsx
index 911f95e8..14a77067 100644
--- a/hooks/use-permissions.tsx
+++ b/hooks/use-permissions.tsx
@@ -95,6 +95,7 @@ export function PermissionsProvider({ children }: { children: React.ReactNode })
const [hasResolvedAdmin, setHasResolvedAdmin] = useState(false)
const [hasFetchedPolicy, setHasFetchedPolicy] = useState(false)
const requestEpochRef = useRef(0)
+ const userPolicyRequestRef = useRef(0)
const [permissionRevision, setPermissionRevision] = useState(0)
const identityKey = JSON.stringify([
isAuthenticated,
@@ -166,35 +167,51 @@ export function PermissionsProvider({ children }: { children: React.ReactNode })
const fetchUserPolicy = useCallback(async () => {
if (!api) return
const requestEpoch = requestEpochRef.current
+ const requestId = userPolicyRequestRef.current + 1
+ userPolicyRequestRef.current = requestId
+ // Same-identity refreshes may overlap; only the newest request can publish.
+ const isCurrentRequest = () =>
+ requestEpoch === requestEpochRef.current && requestId === userPolicyRequestRef.current
setIsLoading(true)
// /is-admin includes IAM administrators; /account/info reports caller.is_owner.
const ownerRequest = api.get("/account/info", { suppress403Redirect: true }).then(
(info) => {
- if (requestEpoch === requestEpochRef.current) setIsOwner((info as { is_admin?: unknown })?.is_admin === true)
+ if (isCurrentRequest()) setIsOwner((info as { is_admin?: unknown })?.is_admin === true)
},
() => {
- if (requestEpoch === requestEpochRef.current) setIsOwner(false)
+ if (isCurrentRequest()) setIsOwner(false)
},
)
try {
- const info = (await api.get("/accountinfo", { suppress403Redirect: true })) as Record