{"record":{"id":"cda5ccb7b4296e74","repo":"tinyhumansai/openhuman","slug":"core-rejected-the-meet-set-event-policy-request","errorCode":null,"errorMessage":"Core rejected the meet_set_event_policy request.","messagePattern":"Core rejected the meet_set_event_policy request\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/services/meetCallService.ts","lineNumber":440,"sourceCode":"interface CoreGetEventPoliciesResponse {\n  ok: boolean;\n  policies: Record<string, string>;\n}\n\n/**\n * Persist a per-event join-policy override for a specific calendar event.\n * Resolution order (Rust side): per-event > per-platform > global.\n */\nexport async function setEventPolicy(\n  calendarEventId: string,\n  policy: 'auto' | 'ask' | 'skip'\n): Promise<void> {\n  const result = await callCoreRpc<CoreSetEventPolicyResponse>({\n    method: 'openhuman.meet_set_event_policy',\n    params: { calendar_event_id: calendarEventId, policy },\n  });\n  if (!result?.ok) {\n    throw new Error('Core rejected the meet_set_event_policy request.');\n  }\n}\n\n/**\n * Batch-fetch per-event join-policy overrides for the given calendar event IDs.\n * Only IDs that have an explicit override are present in the returned map.\n */\nexport async function getEventPolicies(\n  calendarEventIds: string[]\n): Promise<Record<string, string>> {\n  if (calendarEventIds.length === 0) return {};\n  const result = await callCoreRpc<CoreGetEventPoliciesResponse>({\n    method: 'openhuman.meet_get_event_policies',\n    params: { calendar_event_ids: calendarEventIds },\n  });\n  if (!result?.ok) {\n    throw new Error('Core rejected the meet_get_event_policies request.');\n  }","sourceCodeStart":422,"sourceCodeEnd":458,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/services/meetCallService.ts#L422-L458","documentation":"`openhuman.meet_set_event_policy` resolved with `ok` falsy. This persists a per-event join-policy override ('auto' | 'ask' | 'skip') with resolution order per-event > per-platform > global on the Rust side. Failure means the handler refused the write: unknown calendar_event_id (event deleted or from another calendar), invalid policy value, or persistence error in the policy store.","triggerScenarios":"Passing an event id the core does not know (deleted event, id from a different calendar account, stale UI row after a sync); a policy string outside the enum (e.g. localized or legacy 'never'); the events/policy store failing to write.","commonSituations":"User clicks a policy control on a calendar row that is being removed by a concurrent sync; frontend sends an untranslated vs translated value after i18n changes; store file locked or corrupted.","solutions":["Refresh the event list and retry with a currently-valid calendar_event_id","Ensure policy is exactly one of 'auto' | 'ask' | 'skip' at the call site (type it as the union)","Check core logs for the set_event_policy refusal reason","If persistent, inspect the events policy store state in the workspace"],"exampleFix":"// before\nawait setEventPolicy(eventId, policyFromString(e.target.value));\n\n// after\ntype Policy = 'auto' | 'ask' | 'skip';\nconst POLICIES: Policy[] = ['auto', 'ask', 'skip'];\nconst raw = e.target.value as Policy;\nif (!POLICIES.includes(raw)) return;\nawait setEventPolicy(eventId, raw);","handlingStrategy":"validation","validationCode":"type Policy = 'auto' | 'ask' | 'skip';\nconst isPolicy = (v: unknown): v is Policy => v === 'auto' || v === 'ask' || v === 'skip';\nif (!calendarEventId.trim() || !isPolicy(policy)) return; // skip invalid writes","typeGuard":"function isPolicy(v: unknown): v is 'auto' | 'ask' | 'skip' {\n  return v === 'auto' || v === 'ask' || v === 'skip';\n}","tryCatchPattern":"try { await setEventPolicy(id, policy); }\ncatch (e) { toast('Could not save join policy — refresh the calendar and retry.'); }","preventionTips":["Type policy as the literal union end-to-end so invalid values cannot reach the RPC","Ignore policy writes for events already removed by a concurrent sync (row unmount)","Re-derive event ids from the freshest calendar snapshot before batch policy writes"],"tags":["meet","calendar","core-rpc","persistence"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}