{"record":{"id":"195fac38af39c605","repo":"beekeeper-studio/beekeeper-studio","slug":"memberships-are-only-available-in-cloud-workspaces","errorCode":null,"errorMessage":"Memberships are only available in cloud workspaces","messagePattern":"Memberships are only available in cloud workspaces","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/studio/src/store/modules/data/membership/UtilMembershipModule.ts","lineNumber":12,"sourceCode":"import _ from \"lodash\";\nimport { IMembership } from \"@/common/interfaces/IMembership\";\nimport {\n  DataState,\n  DataStore,\n  mutationsFor,\n} from \"@/store/modules/data/DataModuleBase\";\n\ntype State = DataState<IMembership>;\n\nconst localOnly = () => {\n  throw new Error(\"Memberships are only available in cloud workspaces\");\n};\n\nexport const UtilMembershipModule: DataStore<IMembership, State> = {\n  namespaced: true,\n  state: {\n    items: [],\n    loading: false,\n    error: null,\n    pollError: null,\n  },\n  mutations: mutationsFor<IMembership>({}, { field: \"name\", direction: \"asc\" }),\n  actions: {\n    async initialize() {\n      // noop\n    },\n    async load() {\n      // no-op: memberships are cloud-only\n    },","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/beekeeper-studio/beekeeper-studio/blob/4e3e03e3223b2b71a1af8926d455f533b80af837/apps/studio/src/store/modules/data/membership/UtilMembershipModule.ts#L1-L30","documentation":"UtilMembershipModule deliberately throws for every local mutation/action via the localOnly helper. Memberships are a cloud-workspace-only concept, so the module intentionally rejects all local operations (save, remove, etc.) instead of storing membership data in the local database.","triggerScenarios":"Any commit/dispatch against the 'utilMembership' store namespace (e.g. utilMembership/save, utilMembership/remove) while not connected to a cloud workspace, or any code path invoking these actions unconditionally.","commonSituations":"Calling membership sync code in a local (non-cloud) workspace; feature code that assumes a cloud connection and calls membership actions unconditionally; tests running without a cloud workspace context.","solutions":["Check the current workspace type before touching membership actions: only call them for cloud workspaces.","Gate membership UI/sync behind the cloud-workspace flag in the store or component.","Wrap calls in try/catch and ignore the error for local workspaces if the operation is optional.","Use the correct cloud membership module/API instead of the local util module."],"exampleFix":"// before\nstore.dispatch('data/utilMembership/save', membership);\n// after\nif (store.state.workspace?.type === 'cloud') {\n  store.dispatch('data/utilMembership/save', membership);\n}","handlingStrategy":"type-guard","validationCode":"if (store.state.utilWorkspace?.isCloud !== true) return; // skip membership ops for local workspaces","typeGuard":"function isCloudWorkspace(ws: { type?: string } | null | undefined): ws is { type: 'cloud' } {\n  return ws?.type === 'cloud';\n}","tryCatchPattern":"try {\n  store.dispatch('data/utilMembership/save', membership);\n} catch (e) {\n  if (!/cloud workspaces/.test(e.message)) throw e; // ignore on local workspace\n}","preventionTips":["Gate all membership features behind a cloud-workspace check","Hide membership UI entirely in local workspaces","Use the cloud API module for membership data instead of local store modules"],"tags":["vuex","cloud","workspace","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"4e3e03e3223b2b71a1af8926d455f533b80af837","analyzedAt":"2026-08-31T23:21:23.379Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}