koala73/worldmonitor · error · Error
Sign in to revoke API keys.
Error message
Sign in to revoke API keys.
What it means
UI service error in revokeApiKey: no Clerk user is currently authenticated. Revocation requires knowing whose key is being revoked; the guard fires before any Convex call.
Source
Thrown at src/services/api-keys.ts:105
const [client, api] = await Promise.all([getConvexClient(), getConvexApi()]);
if (!client || !api) return [];
if (!await waitForConvexAuthForUser(userId)) {
assertAccountStillCurrent(userId, 'loading API keys');
throw new Error('Authentication unavailable while loading API keys. Try again.');
}
return settleAccountOperation(
userId,
'loading API keys',
() => client.query((api as any).apiKeys.listApiKeys, {}),
);
}
/** Revoke an API key by its Convex document ID. */
export async function revokeApiKey(keyId: string): Promise<void> {
const userId = getCurrentClerkUser()?.id;
if (!userId) throw new Error('Sign in to revoke API keys.');
const [client, api] = await Promise.all([getConvexClient(), getConvexApi()]);
if (!client || !api) throw new Error('Convex unavailable');
if (!await waitForConvexAuthForUser(userId)) {
throw new Error('Account changed while revoking the API key. Try again.');
}
const result = await settleAccountOperation(
userId,
'revoking the API key',
() => client.mutation((api as any).apiKeys.revokeApiKey, { keyId }),
);
assertAccountStillCurrent(userId, 'revoking the API key');
// Await cache bust so the gateway stops accepting the revoked key immediately.
// If this fails, the 60s cache TTL limits the staleness window.
if (result?.keyHash) {
const token = await settleAccountOperation(View on GitHub (pinned to eeab0a219f)
Solutions
- Sign in and retry the revocation
- Wait for the Clerk session to finish loading if sign-in just happened
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/services/api-keys.ts:105 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of koala73/worldmonitor@eeab0a219f (2026-08-21).
Data as JSON: /api/errors/82680d1acdf6bc5e.
Report an issue: GitHub.