Skip to main content

handle_task_query_changes

Function handle_task_query_changes 

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

Handle a Task/queryChanges method call (draft-tasks-06 §4.14).

args is the RFC 8620 §5.6 /queryChanges request shape (accountId, optional filter, optional sort, sinceQueryState, optional maxChanges, optional upToId, optional calculateTotal); the returned Value is the §5.6 /queryChanges response shape (accountId, oldQueryState, newQueryState, optional total, removed, added).

using is the request’s capability list (pass jmap_server::CallContext::using); without urn:ietf:params:jmap:metadata a draft-ietf-jmap-metadata-05 §3.6 filter condition is unsupportedFilter (-05 §3).

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, sinceQueryState is missing, or filter, sort, maxChanges or upToId is malformed;
  • accountNotFound when the backend does not know accountId;
  • unsupportedFilter or unsupportedSort as for handle_task_query;
  • cannotCalculateChanges when sinceQueryState was computed in another language or the backend cannot compute the changes since it;
  • tooManyChanges when there are more changes than maxChanges;
  • serverFail when the backend fails.