nexu-io/open-design · error · TeamResourceAuthorityUnavailableError

WORKSPACE_RESOURCE_AUTHORITY_UNAVAILABLE

WORKSPACE_RESOURCE_AUTHORITY_UNAVAILABLE

Error message

team resource authority is temporarily unavailable

What it means

Thrown as `TeamResourceAuthorityUnavailableError` (HTTP 503, `code = WORKSPACE_RESOURCE_AUTHORITY_UNAVAILABLE`, `retryable = true`) when the authoritative live read of shared resources rejects during `unshare`. The unshare path treats this read as the idempotency boundary — a cached/session fallback may still remember an already-removed design system and must never authorize moving the independently shareable backing project, so the error is surfaced for retry rather than fallen back from.

Solutions

  1. Retry the unshare after a short backoff — the error is marked `retryable`.
  2. If it persists, verify Team hub / Vela CLI connectivity and the login session.
  3. Do NOT fall back to a cached resource list to authorize the unshare; that would bypass the idempotency boundary.
Defensive patterns

Strategy: retry

Validate before calling

// No deterministic pre-check: the authority read itself may fail.
// Perform a lightweight hub health check before unshare if available:
if (typeof resource.pingAuthority === 'function') {
  await resource.pingAuthority(scope); // throws if hub unreachable
}
await linkedShare.unshare(resourceId, scope);

Try / catch

import { TeamResourceAuthorityUnavailableError } from '../collab/team-resource-share.js';

async function unshareWithRetry(resourceId, scope, attempts = 3) {
  for (let i = 0; i < attempts; i += 1) {
    try {
      return await linkedShare.unshare(resourceId, scope);
    } catch (err) {
      if (err instanceof TeamResourceAuthorityUnavailableError && i < attempts - 1) {
        await new Promise((r) => setTimeout(r, 500 * (i + 1)));
        continue;
      }
      throw err;
    }
  }
}

Prevention

When it happens

Trigger: Calling `unshare`; `resource.sharedResources(scope, { authoritative: true })` throws (network failure, hub outage, auth error, timeout) before the candidate can be found.

Common situations: Transient Team hub outage or network blip during an unshare. The Vela CLI/login session is temporarily unavailable. Rate limiting from the hub. This is explicitly retryable — callers should distinguish it from an authoritative empty result.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/1ffab6703b62b988. Report an issue: GitHub.

Appendix: source

Thrown at apps/daemon/src/design-systems/team-project-share.ts:231

              error,
              compensationError('share', rollbackError, forwardError),
            );
          }
        }
        throw error;
      }
      return result;
    },
    async unshare(resourceId, scope) {
      // This live read is the idempotency boundary. A cached/session fallback
      // may still remember an already-removed design system, so it must never
      // authorize moving the independently shareable backing project.
      let sharedResource;
      try {
        sharedResource = (await resource.sharedResources(scope, { authoritative: true }))
          .find((candidate) => candidate.id === resourceId);
      } catch (error) {
        throw new TeamResourceAuthorityUnavailableError(error);
      }
      if (!sharedResource) return false;
      if (!sharedResource.canUnshare) {
        throw new TeamResourceShareForbiddenError();
      }
      const linkedProject = await options.prepare(resourceId, scope);
      await linkedProject.transition('personal');
      try {
        return await resource.unshare(resourceId, scope);
      } catch (error) {
        try {
          await linkedProject.transition('team');
        } catch (rollbackError) {
          // Same convergence rule in reverse: when restoring Team also fails,
          // retry the original resource removal once. A success means both
          // halves are Personal and the requested unshare can truthfully
          // complete.
          try {

View on GitHub (pinned to 5be4028344)