{"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/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/services/meetCallService.ts#L422-L458","documentation":"The openhuman.meet_set_event_policy RPC — persisting a per-event auto/ask/skip join-policy override — answered ok:false, meaning the write failed core-side. Per the doc, resolution order on the Rust side is per-event > per-platform > global, so a failed per-event write leaves the effective policy resolved from the coarser levels.","triggerScenarios":"setEventPolicy(calendarEventId, policy) with an event ID the core cannot persist against (unknown/foreign calendar); the policy store (workspace persistence) failing to write; a policy value outside 'auto'|'ask'|'skip' reaching the wire (type-cast callers); calendar disconnected so event resolution fails.","commonSituations":"Toggle in the upcoming-meetings list flipped before calendar sync completed; corrupted policy store; calendar event deleted server-side between list render and policy save.","solutions":["Confirm the calendar event ID is current (re-list upcoming meetings) and the calendar is still connected","Check core logs for the persistence error on the policy write path","Type the policy parameter as the literal union so invalid values fail at compile time","Optimistically update the toggle but revert on catch and re-throw to a toast"],"exampleFix":"// before\nawait setEventPolicy(eventId, policy as string);\n\n// after\ntype JoinPolicy = 'auto' | 'ask' | 'skip';\nawait setEventPolicy(eventId, policy satisfies JoinPolicy);","handlingStrategy":"try-catch","validationCode":"type JoinPolicy = 'auto' | 'ask' | 'skip';\nconst POLICIES: readonly JoinPolicy[] = ['auto', 'ask', 'skip'];\nfunction isJoinPolicy(v: unknown): v is JoinPolicy {\n  return typeof v === 'string' && (POLICIES as readonly string[]).includes(v);\n}","typeGuard":"function isSetPolicyRejected(err: unknown): boolean {\n  return err instanceof Error && err.message.includes('meet_set_event_policy');\n}","tryCatchPattern":"setOptimisticPolicy(eventId, policy);\ntry {\n  await setEventPolicy(eventId, policy);\n} catch (err) {\n  revertOptimisticPolicy(eventId); // effective policy falls back to per-platform/global\n  toast('Could not save join policy for this event.');\n}","preventionTips":["Type policy as the literal union so invalid values fail at compile time","Use optimistic UI with revert — a failed per-event write is always recoverable","Confirm the event ID is from the current calendar listing before saving"],"tags":["meet","policy","persistence","rpc","ok-flag","calendar"],"backgroundTag":"rpc-ok-false-rejection","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}