Skip to main content

handle_task_set

Function handle_task_set 

Source
pub async fn handle_task_set<B: TasksBackend>(
    backend: &B,
    caller: &B::CallerCtx,
    args: Value,
) -> Result<HandlerOutput, JmapError>
Expand description

Handle a Task/set method call (draft-tasks-06 §4.7).

args is the RFC 8620 §5.3 /set request shape (accountId, optional ifInState, optional create / update / destroy maps); the returned Value is the §5.3 /set response shape (accountId, oldState, newState, plus the per-operation result maps).

isDraft immutability: If a patch contains "isDraft": true and the current stored object does not have isDraft = true, the update is rejected with invalidProperties. The current object must be fetched from the backend to check this.

Note: The backend returns the current object via get_objects for the isDraft check. This is not done here to avoid coupling to the stored state; instead, backends are expected to enforce this constraint and return invalidProperties from update_object when the patch violates it. The handler also does a best-effort check on the patch itself.

Returns (response_args, extra_invocations). The extra list is always empty.