{"record":{"id":"1ffab6703b62b988","repo":"nexu-io/open-design","slug":"workspace-resource-authority-unavailable-1ffab6","errorCode":"WORKSPACE_RESOURCE_AUTHORITY_UNAVAILABLE","errorMessage":"team resource authority is temporarily unavailable","messagePattern":"team resource authority is temporarily unavailable","errorType":"exception","errorClass":"TeamResourceAuthorityUnavailableError","httpStatus":503,"severity":"error","filePath":"apps/daemon/src/design-systems/team-project-share.ts","lineNumber":231,"sourceCode":"              error,\n              compensationError('share', rollbackError, forwardError),\n            );\n          }\n        }\n        throw error;\n      }\n      return result;\n    },\n    async unshare(resourceId, scope) {\n      // This live read is the idempotency boundary. A cached/session fallback\n      // may still remember an already-removed design system, so it must never\n      // authorize moving the independently shareable backing project.\n      let sharedResource;\n      try {\n        sharedResource = (await resource.sharedResources(scope, { authoritative: true }))\n          .find((candidate) => candidate.id === resourceId);\n      } catch (error) {\n        throw new TeamResourceAuthorityUnavailableError(error);\n      }\n      if (!sharedResource) return false;\n      if (!sharedResource.canUnshare) {\n        throw new TeamResourceShareForbiddenError();\n      }\n      const linkedProject = await options.prepare(resourceId, scope);\n      await linkedProject.transition('personal');\n      try {\n        return await resource.unshare(resourceId, scope);\n      } catch (error) {\n        try {\n          await linkedProject.transition('team');\n        } catch (rollbackError) {\n          // Same convergence rule in reverse: when restoring Team also fails,\n          // retry the original resource removal once. A success means both\n          // halves are Personal and the requested unshare can truthfully\n          // complete.\n          try {","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/design-systems/team-project-share.ts#L213-L249","documentation":"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.","triggerScenarios":"Calling `unshare`; `resource.sharedResources(scope, { authoritative: true })` throws (network failure, hub outage, auth error, timeout) before the candidate can be found.","commonSituations":"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.","solutions":["Retry the unshare after a short backoff — the error is marked `retryable`.","If it persists, verify Team hub / Vela CLI connectivity and the login session.","Do NOT fall back to a cached resource list to authorize the unshare; that would bypass the idempotency boundary."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// No deterministic pre-check: the authority read itself may fail.\n// Perform a lightweight hub health check before unshare if available:\nif (typeof resource.pingAuthority === 'function') {\n  await resource.pingAuthority(scope); // throws if hub unreachable\n}\nawait linkedShare.unshare(resourceId, scope);","typeGuard":null,"tryCatchPattern":"import { TeamResourceAuthorityUnavailableError } from '../collab/team-resource-share.js';\n\nasync function unshareWithRetry(resourceId, scope, attempts = 3) {\n  for (let i = 0; i < attempts; i += 1) {\n    try {\n      return await linkedShare.unshare(resourceId, scope);\n    } catch (err) {\n      if (err instanceof TeamResourceAuthorityUnavailableError && i < attempts - 1) {\n        await new Promise((r) => setTimeout(r, 500 * (i + 1)));\n        continue;\n      }\n      throw err;\n    }\n  }\n}","preventionTips":["Retry on TeamResourceAuthorityUnavailableError — it is explicitly retryable (503).","Never fall back to a cached resource list to authorize unshare; the authoritative read is the idempotency boundary.","Surface these as transient errors to users rather than permanent failures."],"tags":["team","design-system","workspace","share","retryable","authority","vela"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}