Skip to main content

handle_task_notification_query

Function handle_task_notification_query 

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

Handle a TaskNotification/query method call (draft-tasks-06 §5.5).

args is the RFC 8620 §5.5 /query request shape (accountId, optional filter, optional sort, optional position, optional anchor, optional anchorOffset, optional limit, optional calculateTotal); the returned Value is the §5.5 /query response shape (accountId, queryState, canCalculateChanges, position, ids, optional total).

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 filter, sort, position, anchor, anchorOffset or limit is malformed;
  • accountNotFound when the backend does not know accountId;
  • unsupportedFilter when the filter does not decode as a TaskNotification filter;
  • unsupportedSort when sort names a property that is not supported;
  • serverFail when the backend fails, or any other RFC 8620 §5.5 error the backend returns, such as anchorNotFound.