Skip to main content

handle_task_notification_set

Function handle_task_notification_set 

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

Handle a TaskNotification/set method call (draft-tasks-06 §5.4).

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).

Destroy-only enforcement: draft-tasks-06 §5.4 states that only destroy is supported. Any entries in the create or update maps receive an immediate forbidden SetError without touching the backend. The destroy list is forwarded to the backend normally.

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

§Errors

Returns a method-level JmapError:

  • invalidArguments when accountId is missing or not a valid Id, or when destroy is malformed;
  • accountNotFound when the backend does not know accountId;
  • requestTooLarge when create, update and destroy together hold more than maxObjectsInSet objects;
  • stateMismatch when ifInState is not the current state;
  • serverFail when the backend fails.

A create or update is a forbidden SetError, and a destroy that fails on its own is a SetError in notDestroyed, not an Err.